diff options
author | Ming Lei <tom.leiming@gmail.com> | 2011-11-17 00:34:32 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2011-12-06 02:16:55 -0500 |
commit | 81140acc66322dcde8346dabdf1ab4c229fce8d4 (patch) | |
tree | 45a3da1b4edc7a5a7c6ef9a213927e93cf815fef /kernel/lockdep.c | |
parent | 73839c5b2eacc15cb0aa79c69b285fc659fa8851 (diff) |
lockdep: Print lock name in lockdep_init_error()
This patch prints the name of the lock which is acquired
before lockdep_init() is called, so that users can easily
find which lock triggered the lockdep init error warning.
This patch also removes the lockdep_init_error() message
of "Arch code didn't call lockdep_init() early enough?"
since lockdep_init() is called in arch independent code now.
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1321508072-23853-2-git-send-email-tom.leiming@gmail.com
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/lockdep.c')
-rw-r--r-- | kernel/lockdep.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/kernel/lockdep.c b/kernel/lockdep.c index 54cc0dc7b303..e69d633d6aa6 100644 --- a/kernel/lockdep.c +++ b/kernel/lockdep.c | |||
@@ -431,6 +431,7 @@ unsigned int max_lockdep_depth; | |||
431 | * about it later on, in lockdep_info(). | 431 | * about it later on, in lockdep_info(). |
432 | */ | 432 | */ |
433 | static int lockdep_init_error; | 433 | static int lockdep_init_error; |
434 | static const char *lock_init_error; | ||
434 | static unsigned long lockdep_init_trace_data[20]; | 435 | static unsigned long lockdep_init_trace_data[20]; |
435 | static struct stack_trace lockdep_init_trace = { | 436 | static struct stack_trace lockdep_init_trace = { |
436 | .max_entries = ARRAY_SIZE(lockdep_init_trace_data), | 437 | .max_entries = ARRAY_SIZE(lockdep_init_trace_data), |
@@ -657,6 +658,7 @@ look_up_lock_class(struct lockdep_map *lock, unsigned int subclass) | |||
657 | if (unlikely(!lockdep_initialized)) { | 658 | if (unlikely(!lockdep_initialized)) { |
658 | lockdep_init(); | 659 | lockdep_init(); |
659 | lockdep_init_error = 1; | 660 | lockdep_init_error = 1; |
661 | lock_init_error = lock->name; | ||
660 | save_stack_trace(&lockdep_init_trace); | 662 | save_stack_trace(&lockdep_init_trace); |
661 | } | 663 | } |
662 | #endif | 664 | #endif |
@@ -3978,7 +3980,8 @@ void __init lockdep_info(void) | |||
3978 | 3980 | ||
3979 | #ifdef CONFIG_DEBUG_LOCKDEP | 3981 | #ifdef CONFIG_DEBUG_LOCKDEP |
3980 | if (lockdep_init_error) { | 3982 | if (lockdep_init_error) { |
3981 | printk("WARNING: lockdep init error! Arch code didn't call lockdep_init() early enough?\n"); | 3983 | printk("WARNING: lockdep init error! lock-%s was acquired" |
3984 | "before lockdep_init\n", lock_init_error); | ||
3982 | printk("Call stack leading to lockdep invocation was:\n"); | 3985 | printk("Call stack leading to lockdep invocation was:\n"); |
3983 | print_stack_trace(&lockdep_init_trace, 0); | 3986 | print_stack_trace(&lockdep_init_trace, 0); |
3984 | } | 3987 | } |