diff options
author | Dave Jones <davej@redhat.com> | 2013-04-25 13:40:02 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2013-04-26 02:37:22 -0400 |
commit | 2c522836627c6e78660f8bd52cdb4cdcb75e3e3c (patch) | |
tree | 7e10e6d8a4bc303ecd4211882f3eddc8f879f4cd | |
parent | 199e371f59d31c828345b0d959d27d752827b517 (diff) |
lockdep: Consolidate bug messages into a single print_lockdep_off() function
Also add some missing printk levels.
Signed-off-by: Dave Jones <davej@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/20130425174002.GA26769@redhat.com
[ Tweaked the messages a bit. ]
Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r-- | kernel/lockdep.c | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/kernel/lockdep.c b/kernel/lockdep.c index c5d1e6bbdb3e..6a3bccba7e7d 100644 --- a/kernel/lockdep.c +++ b/kernel/lockdep.c | |||
@@ -380,6 +380,13 @@ static int verbose(struct lock_class *class) | |||
380 | unsigned long nr_stack_trace_entries; | 380 | unsigned long nr_stack_trace_entries; |
381 | static unsigned long stack_trace[MAX_STACK_TRACE_ENTRIES]; | 381 | static unsigned long stack_trace[MAX_STACK_TRACE_ENTRIES]; |
382 | 382 | ||
383 | static void print_lockdep_off(const char *bug_msg) | ||
384 | { | ||
385 | printk(KERN_DEBUG "%s\n", bug_msg); | ||
386 | printk(KERN_DEBUG "turning off the locking correctness validator.\n"); | ||
387 | printk(KERN_DEBUG "Please attach the output of /proc/lock_stat to the bug report\n"); | ||
388 | } | ||
389 | |||
383 | static int save_trace(struct stack_trace *trace) | 390 | static int save_trace(struct stack_trace *trace) |
384 | { | 391 | { |
385 | trace->nr_entries = 0; | 392 | trace->nr_entries = 0; |
@@ -409,9 +416,7 @@ static int save_trace(struct stack_trace *trace) | |||
409 | if (!debug_locks_off_graph_unlock()) | 416 | if (!debug_locks_off_graph_unlock()) |
410 | return 0; | 417 | return 0; |
411 | 418 | ||
412 | printk("BUG: MAX_STACK_TRACE_ENTRIES too low!\n"); | 419 | print_lockdep_off("BUG: MAX_STACK_TRACE_ENTRIES too low!"); |
413 | printk("turning off the locking correctness validator.\n"); | ||
414 | printk("Attach output of /proc/lock_stat to bug report\n"); | ||
415 | dump_stack(); | 420 | dump_stack(); |
416 | 421 | ||
417 | return 0; | 422 | return 0; |
@@ -764,9 +769,7 @@ register_lock_class(struct lockdep_map *lock, unsigned int subclass, int force) | |||
764 | } | 769 | } |
765 | raw_local_irq_restore(flags); | 770 | raw_local_irq_restore(flags); |
766 | 771 | ||
767 | printk("BUG: MAX_LOCKDEP_KEYS too low!\n"); | 772 | print_lockdep_off("BUG: MAX_LOCKDEP_KEYS too low!"); |
768 | printk("turning off the locking correctness validator.\n"); | ||
769 | printk("Attach output of /proc/lock_stat to bug report\n"); | ||
770 | dump_stack(); | 773 | dump_stack(); |
771 | return NULL; | 774 | return NULL; |
772 | } | 775 | } |
@@ -836,9 +839,7 @@ static struct lock_list *alloc_list_entry(void) | |||
836 | if (!debug_locks_off_graph_unlock()) | 839 | if (!debug_locks_off_graph_unlock()) |
837 | return NULL; | 840 | return NULL; |
838 | 841 | ||
839 | printk("BUG: MAX_LOCKDEP_ENTRIES too low!\n"); | 842 | print_lockdep_off("BUG: MAX_LOCKDEP_ENTRIES too low!"); |
840 | printk("turning off the locking correctness validator.\n"); | ||
841 | printk("Attach output of /proc/lock_stat to bug report\n"); | ||
842 | dump_stack(); | 843 | dump_stack(); |
843 | return NULL; | 844 | return NULL; |
844 | } | 845 | } |
@@ -2051,9 +2052,7 @@ cache_hit: | |||
2051 | if (!debug_locks_off_graph_unlock()) | 2052 | if (!debug_locks_off_graph_unlock()) |
2052 | return 0; | 2053 | return 0; |
2053 | 2054 | ||
2054 | printk("BUG: MAX_LOCKDEP_CHAINS too low!\n"); | 2055 | print_lockdep_off("BUG: MAX_LOCKDEP_CHAINS too low!"); |
2055 | printk("turning off the locking correctness validator.\n"); | ||
2056 | printk("Attach output of /proc/lock_stat to bug report\n"); | ||
2057 | dump_stack(); | 2056 | dump_stack(); |
2058 | return 0; | 2057 | return 0; |
2059 | } | 2058 | } |
@@ -3192,10 +3191,9 @@ static int __lock_acquire(struct lockdep_map *lock, unsigned int subclass, | |||
3192 | #endif | 3191 | #endif |
3193 | if (unlikely(curr->lockdep_depth >= MAX_LOCK_DEPTH)) { | 3192 | if (unlikely(curr->lockdep_depth >= MAX_LOCK_DEPTH)) { |
3194 | debug_locks_off(); | 3193 | debug_locks_off(); |
3195 | printk("BUG: MAX_LOCK_DEPTH too low, depth: %i max: %lu!\n", | 3194 | print_lockdep_off("BUG: MAX_LOCK_DEPTH too low!"); |
3195 | printk(KERN_DEBUG "depth: %i max: %lu!\n", | ||
3196 | curr->lockdep_depth, MAX_LOCK_DEPTH); | 3196 | curr->lockdep_depth, MAX_LOCK_DEPTH); |
3197 | printk("turning off the locking correctness validator.\n"); | ||
3198 | printk("Attach output of /proc/lock_stat to bug report\n"); | ||
3199 | 3197 | ||
3200 | lockdep_print_held_locks(current); | 3198 | lockdep_print_held_locks(current); |
3201 | debug_show_all_locks(); | 3199 | debug_show_all_locks(); |