mm: kmemleak: Don't require global debug options or debugfs

This allows kmemleak to function even when debugfs is globally disabled,
allowing kmemleak to give accurate results for CONFIG_DEBUG_FS=n.

Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
Signed-off-by: Carlos Jimenez (JavaShin-X) <javashin1986@gmail.com>
This commit is contained in:
Sultan Alsawaf 2020-12-05 19:46:01 -08:00 committed by Cyber Knight
parent a8bcf50477
commit 725df8b76b
No known key found for this signature in database
GPG Key ID: 23BD4CCD326E9D64
4 changed files with 12 additions and 4 deletions

View File

@ -123,7 +123,11 @@ obj-$(CONFIG_NILFS2_FS) += nilfs2/
obj-$(CONFIG_BEFS_FS) += befs/
obj-$(CONFIG_HOSTFS) += hostfs/
obj-$(CONFIG_CACHEFILES) += cachefiles/
obj-$(CONFIG_DEBUG_FS) += debugfs/
ifeq ($(CONFIG_DEBUG_FS),y)
obj-y += debugfs/
else
obj-$(CONFIG_DEBUG_KMEMLEAK) += debugfs/
endif
obj-$(CONFIG_TRACING) += tracefs/
obj-$(CONFIG_OCFS2_FS) += ocfs2/
obj-$(CONFIG_BTRFS_FS) += btrfs/

View File

@ -1,4 +1,7 @@
debugfs-objs := inode.o file.o
obj-$(CONFIG_DEBUG_FS) += debugfs.o
ifeq ($(CONFIG_DEBUG_KMEMLEAK),y)
ccflags-y := -DCONFIG_DEBUG_FS
endif
obj-y += debugfs.o

View File

@ -589,8 +589,7 @@ config HAVE_DEBUG_KMEMLEAK
config DEBUG_KMEMLEAK
bool "Kernel memory leak detector"
depends on DEBUG_KERNEL && HAVE_DEBUG_KMEMLEAK
select DEBUG_FS
depends on HAVE_DEBUG_KMEMLEAK
select STACKTRACE if STACKTRACE_SUPPORT
select KALLSYMS
select CRC32

View File

@ -105,3 +105,5 @@ obj-$(CONFIG_HARDENED_USERCOPY) += usercopy.o
obj-$(CONFIG_PERCPU_STATS) += percpu-stats.o
obj-$(CONFIG_HMM) += hmm.o
obj-$(CONFIG_PROCESS_RECLAIM) += process_reclaim.o
CFLAGS_kmemleak.o += -DCONFIG_DEBUG_FS