diff options
author | Catalin Marinas <catalin.marinas@arm.com> | 2009-06-11 14:22:39 +0200 |
---|---|---|
committer | Catalin Marinas <catalin.marinas@arm.com> | 2009-06-11 18:03:28 +0200 |
commit | 3c7b4e6b8be4c16f1e6e5c558e33b7ff0db2dfaf (patch) | |
tree | 3722fc5220bf8d611def5618758b05160ff05312 /init | |
parent | Merge branch 'tracing-urgent-for-linus' of git://git.kernel.org/pub/scm/linux... (diff) | |
download | linux-3c7b4e6b8be4c16f1e6e5c558e33b7ff0db2dfaf.tar.xz linux-3c7b4e6b8be4c16f1e6e5c558e33b7ff0db2dfaf.zip |
kmemleak: Add the base support
This patch adds the base support for the kernel memory leak
detector. It traces the memory allocation/freeing in a way similar to
the Boehm's conservative garbage collector, the difference being that
the unreferenced objects are not freed but only shown in
/sys/kernel/debug/kmemleak. Enabling this feature introduces an
overhead to memory allocations.
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Cc: Ingo Molnar <mingo@elte.hu>
Acked-by: Pekka Enberg <penberg@cs.helsinki.fi>
Cc: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Diffstat (limited to 'init')
-rw-r--r-- | init/main.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/init/main.c b/init/main.c index bb7dc57eee36..9d759d68d7a0 100644 --- a/init/main.c +++ b/init/main.c @@ -56,6 +56,7 @@ #include <linux/debug_locks.h> #include <linux/debugobjects.h> #include <linux/lockdep.h> +#include <linux/kmemleak.h> #include <linux/pid_namespace.h> #include <linux/device.h> #include <linux/kthread.h> @@ -603,6 +604,7 @@ asmlinkage void __init start_kernel(void) /* init some links before init_ISA_irqs() */ early_irq_init(); init_IRQ(); + prio_tree_init(); pidhash_init(); init_timers(); hrtimers_init(); @@ -654,6 +656,7 @@ asmlinkage void __init start_kernel(void) cpu_hotplug_init(); kmem_cache_init(); kmemtrace_init(); + kmemleak_init(); debug_objects_mem_init(); idr_init_cache(); setup_per_cpu_pageset(); @@ -663,7 +666,6 @@ asmlinkage void __init start_kernel(void) calibrate_delay(); pidmap_init(); pgtable_cache_init(); - prio_tree_init(); anon_vma_init(); #ifdef CONFIG_X86 if (efi_enabled) |