Loading lib/Kconfig.debug +9 −0 Original line number Diff line number Diff line Loading @@ -1057,6 +1057,15 @@ config DEBUG_TIMEKEEPING If unsure, say N. config DEBUG_TASK_STACK_SCAN_OFF bool "Disable kmemleak task stack scan by default" depends on DEBUG_KMEMLEAK help Say Y here to disable kmemleak task stack scan by default at compile time. It can be enabled later if required by writing to the debugfs entry : echo "stack=on" > /sys/kernel/debug/kmemleak. config DEBUG_PREEMPT bool "Debug preemptible kernel" depends on DEBUG_KERNEL && PREEMPT && TRACE_IRQFLAGS_SUPPORT Loading mm/kmemleak.c +13 −1 Original line number Diff line number Diff line Loading @@ -226,8 +226,20 @@ static unsigned long jiffies_min_age; static unsigned long jiffies_last_scan; /* delay between automatic memory scannings */ static signed long jiffies_scan_wait; /* enables or disables the task stacks scanning */ /* * Enables or disables the task stacks scanning. * Set to 1 if at compile time we want it enabled. * Else set to 0 to have it disabled by default. * This can be enabled by writing to "stack=on" using * kmemleak debugfs entry. */ #ifdef CONFIG_DEBUG_TASK_STACK_SCAN_OFF static int kmemleak_stack_scan; #else static int kmemleak_stack_scan = 1; #endif /* protects the memory scanning, parameters and debug/kmemleak file access */ static DEFINE_MUTEX(scan_mutex); /* setting kmemleak=on, will set this var, skipping the disable */ Loading Loading
lib/Kconfig.debug +9 −0 Original line number Diff line number Diff line Loading @@ -1057,6 +1057,15 @@ config DEBUG_TIMEKEEPING If unsure, say N. config DEBUG_TASK_STACK_SCAN_OFF bool "Disable kmemleak task stack scan by default" depends on DEBUG_KMEMLEAK help Say Y here to disable kmemleak task stack scan by default at compile time. It can be enabled later if required by writing to the debugfs entry : echo "stack=on" > /sys/kernel/debug/kmemleak. config DEBUG_PREEMPT bool "Debug preemptible kernel" depends on DEBUG_KERNEL && PREEMPT && TRACE_IRQFLAGS_SUPPORT Loading
mm/kmemleak.c +13 −1 Original line number Diff line number Diff line Loading @@ -226,8 +226,20 @@ static unsigned long jiffies_min_age; static unsigned long jiffies_last_scan; /* delay between automatic memory scannings */ static signed long jiffies_scan_wait; /* enables or disables the task stacks scanning */ /* * Enables or disables the task stacks scanning. * Set to 1 if at compile time we want it enabled. * Else set to 0 to have it disabled by default. * This can be enabled by writing to "stack=on" using * kmemleak debugfs entry. */ #ifdef CONFIG_DEBUG_TASK_STACK_SCAN_OFF static int kmemleak_stack_scan; #else static int kmemleak_stack_scan = 1; #endif /* protects the memory scanning, parameters and debug/kmemleak file access */ static DEFINE_MUTEX(scan_mutex); /* setting kmemleak=on, will set this var, skipping the disable */ Loading