diff options
author | Catalin Marinas <catalin.marinas@arm.com> | 2009-06-25 11:16:11 +0200 |
---|---|---|
committer | Catalin Marinas <catalin.marinas@arm.com> | 2009-06-25 11:16:13 +0200 |
commit | a9d9058abab4ac17b79d500506e6c74bd16cecdc (patch) | |
tree | 3b12a8f093431979b3e26e04f115b4ce942ce363 /mm/kmemleak.c | |
parent | Linux 2.6.31-rc1 (diff) | |
download | linux-a9d9058abab4ac17b79d500506e6c74bd16cecdc.tar.xz linux-a9d9058abab4ac17b79d500506e6c74bd16cecdc.zip |
kmemleak: Allow the early log buffer to be configurable.
(feature suggested by Sergey Senozhatsky)
Kmemleak needs to track all the memory allocations but some of these
happen before kmemleak is initialised. These are stored in an internal
buffer which may be exceeded in some kernel configurations. This patch
adds a configuration option with a default value of 400 and also removes
the stack dump when the early log buffer is exceeded.
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Sergey Senozhatsky <sergey.senozhatsky@mail.by>
Diffstat (limited to 'mm/kmemleak.c')
-rw-r--r-- | mm/kmemleak.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/mm/kmemleak.c b/mm/kmemleak.c index c96f2c8700aa..17096d1b59b2 100644 --- a/mm/kmemleak.c +++ b/mm/kmemleak.c @@ -235,7 +235,7 @@ struct early_log { }; /* early logging buffer and current position */ -static struct early_log early_log[200]; +static struct early_log early_log[CONFIG_DEBUG_KMEMLEAK_EARLY_LOG_SIZE]; static int crt_early_log; static void kmemleak_disable(void); @@ -696,7 +696,8 @@ static void log_early(int op_type, const void *ptr, size_t size, struct early_log *log; if (crt_early_log >= ARRAY_SIZE(early_log)) { - kmemleak_stop("Early log buffer exceeded\n"); + pr_warning("Early log buffer exceeded\n"); + kmemleak_disable(); return; } |