mm,kmemleak-test: add the dependency on CONFIG_SAMPLES
Subsystems (4)
PATCH v2 1/1 mm,kmemleak-test: add the dependency on CONFIG_SAMPLES
From: Xiang Chen <[email protected]>
As kmemleak-test.c is moved to samples dir, it is not compiled if just setting CONFIG_DEBUG_KMEMLEAK_TEST as module and enabling CONFIG_DEBUG_KMEMLEAK.
So move the DEBUG_KMEMLEAK_TEST option to samples dir as well and rename it to SAMPLE_KMEMLEAK_TEST. And also replace DEBUG_KMEMLEAK_TEST with SAMPLE_KMEMLEAK_TEST in some other places.
--- Documentation/dev-tools/kmemleak.rst | 2 +- lib/Kconfig.debug | 8 -------- samples/Kconfig | 8 ++++++++ samples/Makefile | 2 +- samples/kmemleak/Makefile | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-)
Documentation/dev-tools/kmemleak.rst +1 -1
@@ -228,7 +228,7 @@ Testing with kmemleak-test -------------------------- To check if you have all set up to use kmemleak, you can use the kmemleak-test -module, a module that deliberately leaks memory. Set CONFIG_DEBUG_KMEMLEAK_TEST +module, a module that deliberately leaks memory. Set CONFIG_SAMPLE_KMEMLEAK_TEST as module (it can't be used as built-in) and boot the kernel with kmemleak enabled. Load the module and perform a scan with::
lib/Kconfig.debug +0 -8
@@ -723,14 +723,6 @@ config DEBUG_KMEMLEAK_MEM_POOL_SIZE fully initialised, this memory pool acts as an emergency one if slab allocations fail. -config DEBUG_KMEMLEAK_TEST - tristate "Simple test for the kernel memory leak detector" - depends on DEBUG_KMEMLEAK && m - help - This option enables a module that explicitly leaks memory. - - If unsure, say N. - config DEBUG_KMEMLEAK_DEFAULT_OFF bool "Default kmemleak to off" depends on DEBUG_KMEMLEAK
samples/Kconfig +8 -0
@@ -223,6 +223,14 @@ config SAMPLE_WATCH_QUEUE Build example userspace program to use the new mount_notify(), sb_notify() syscalls and the KEYCTL_WATCH_KEY keyctl() function. +config SAMPLE_KMEMLEAK_TEST + tristate "Simple test for the kernel memory leak detector" + depends on DEBUG_KMEMLEAK && m + help + This option enables a module that explicitly leaks memory. + + If unsure, say N. + source "samples/rust/Kconfig" endif # SAMPLES
samples/Makefile +1 -1
@@ -29,5 +29,5 @@ subdir-$(CONFIG_SAMPLE_VFS) += vfs obj-$(CONFIG_SAMPLE_INTEL_MEI) += mei/ subdir-$(CONFIG_SAMPLE_WATCHDOG) += watchdog subdir-$(CONFIG_SAMPLE_WATCH_QUEUE) += watch_queue -obj-$(CONFIG_DEBUG_KMEMLEAK_TEST) += kmemleak/ +obj-$(CONFIG_SAMPLE_KMEMLEAK_TEST) += kmemleak/ obj-$(CONFIG_SAMPLES_RUST) += rust/
samples/kmemleak/Makefile +1 -1
@@ -1,3 +1,3 @@ # SPDX-License-Identifier: GPL-2.0-only -obj-$(CONFIG_DEBUG_KMEMLEAK_TEST) += kmemleak-test.o +obj-$(CONFIG_SAMPLE_KMEMLEAK_TEST) += kmemleak-test.o
Signature · 1 line
2.8.1
Quoted 11 lines · chenxiang
From: Xiang Chen <[email protected]>
As
kmemleak-test.cis moved to samples dir, it is not compiled if just settingCONFIG_DEBUG_KMEMLEAK_TESTas module and enablingCONFIG_DEBUG_KMEMLEAK.
So move theDEBUG_KMEMLEAK_TESToption to samples dir as well and rename it toSAMPLE_KMEMLEAK_TEST. And also replaceDEBUG_KMEMLEAK_TESTwithSAMPLE_KMEMLEAK_TESTin some other places.Fixes 1abbef4f5172 ("mm,kmemleak-test.c: move kmemleak-test.c to samples dir")Signed-off-by Xiang Chen <[email protected]>