diff options
Diffstat (limited to 'kernel/lockdep.c')
-rw-r--r-- | kernel/lockdep.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/kernel/lockdep.c b/kernel/lockdep.c index 592c576d77a7..7065a687ac54 100644 --- a/kernel/lockdep.c +++ b/kernel/lockdep.c | |||
@@ -2228,6 +2228,10 @@ out_calc_hash: | |||
2228 | 2228 | ||
2229 | curr->lockdep_depth++; | 2229 | curr->lockdep_depth++; |
2230 | check_chain_key(curr); | 2230 | check_chain_key(curr); |
2231 | #ifdef CONFIG_DEBUG_LOCKDEP | ||
2232 | if (unlikely(!debug_locks)) | ||
2233 | return 0; | ||
2234 | #endif | ||
2231 | if (unlikely(curr->lockdep_depth >= MAX_LOCK_DEPTH)) { | 2235 | if (unlikely(curr->lockdep_depth >= MAX_LOCK_DEPTH)) { |
2232 | debug_locks_off(); | 2236 | debug_locks_off(); |
2233 | printk("BUG: MAX_LOCK_DEPTH too low!\n"); | 2237 | printk("BUG: MAX_LOCK_DEPTH too low!\n"); |
@@ -2598,7 +2602,7 @@ out_restore: | |||
2598 | raw_local_irq_restore(flags); | 2602 | raw_local_irq_restore(flags); |
2599 | } | 2603 | } |
2600 | 2604 | ||
2601 | void __init lockdep_init(void) | 2605 | void lockdep_init(void) |
2602 | { | 2606 | { |
2603 | int i; | 2607 | int i; |
2604 | 2608 | ||
@@ -2738,6 +2742,10 @@ void debug_show_all_locks(void) | |||
2738 | int count = 10; | 2742 | int count = 10; |
2739 | int unlock = 1; | 2743 | int unlock = 1; |
2740 | 2744 | ||
2745 | if (unlikely(!debug_locks)) { | ||
2746 | printk("INFO: lockdep is turned off.\n"); | ||
2747 | return; | ||
2748 | } | ||
2741 | printk("\nShowing all locks held in the system:\n"); | 2749 | printk("\nShowing all locks held in the system:\n"); |
2742 | 2750 | ||
2743 | /* | 2751 | /* |
@@ -2781,6 +2789,10 @@ EXPORT_SYMBOL_GPL(debug_show_all_locks); | |||
2781 | 2789 | ||
2782 | void debug_show_held_locks(struct task_struct *task) | 2790 | void debug_show_held_locks(struct task_struct *task) |
2783 | { | 2791 | { |
2792 | if (unlikely(!debug_locks)) { | ||
2793 | printk("INFO: lockdep is turned off.\n"); | ||
2794 | return; | ||
2795 | } | ||
2784 | lockdep_print_held_locks(task); | 2796 | lockdep_print_held_locks(task); |
2785 | } | 2797 | } |
2786 | 2798 | ||