Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 207842
b: refs/heads/master
c: ab0155a
h: refs/heads/master
v: v3
  • Loading branch information
Jason Baron authored and Catalin Marinas committed Jul 19, 2010
1 parent c985020 commit eafceb2
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a7686a45c07462b78df5ac15fc696a86e57ccf91
refs/heads/master: ab0155a22ad5bda3a6dbfbbecc416cbe92619755
7 changes: 7 additions & 0 deletions trunk/lib/Kconfig.debug
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,13 @@ config DEBUG_KMEMLEAK_TEST

If unsure, say N.

config DEBUG_KMEMLEAK_DEFAULT_OFF
bool "Default kmemleak to off"
depends on DEBUG_KMEMLEAK
help
Say Y here to disable kmemleak by default. It can then be enabled
on the command line via kmemleak=on.

config DEBUG_PREEMPT
bool "Debug preemptible kernel"
depends on DEBUG_KERNEL && PREEMPT && TRACE_IRQFLAGS_SUPPORT
Expand Down
14 changes: 13 additions & 1 deletion trunk/mm/kmemleak.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,9 @@ static signed long jiffies_scan_wait;
static int kmemleak_stack_scan = 1;
/* 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 */
static int kmemleak_skip_disable;


/*
* Early object allocation/freeing logging. Kmemleak is initialized after the
Expand Down Expand Up @@ -1604,7 +1607,9 @@ static int kmemleak_boot_config(char *str)
return -EINVAL;
if (strcmp(str, "off") == 0)
kmemleak_disable();
else if (strcmp(str, "on") != 0)
else if (strcmp(str, "on") == 0)
kmemleak_skip_disable = 1;
else
return -EINVAL;
return 0;
}
Expand All @@ -1618,6 +1623,13 @@ void __init kmemleak_init(void)
int i;
unsigned long flags;

#ifdef CONFIG_DEBUG_KMEMLEAK_DEFAULT_OFF
if (!kmemleak_skip_disable) {
kmemleak_disable();
return;
}
#endif

jiffies_min_age = msecs_to_jiffies(MSECS_MIN_AGE);
jiffies_scan_wait = msecs_to_jiffies(SECS_SCAN_WAIT * 1000);

Expand Down

0 comments on commit eafceb2

Please sign in to comment.