simplify the stacktrace code
[powerpc.git] / kernel / lockdep.c
index 8dc24c9..c1e308a 100644 (file)
@@ -257,9 +257,8 @@ static int save_trace(struct stack_trace *trace)
        trace->entries = stack_trace + nr_stack_trace_entries;
 
        trace->skip = 3;
-       trace->all_contexts = 0;
 
-       save_stack_trace(trace, NULL);
+       save_stack_trace(trace);
 
        trace->max_entries = trace->nr_entries;
 
@@ -2742,6 +2741,10 @@ void debug_show_all_locks(void)
        int count = 10;
        int unlock = 1;
 
+       if (unlikely(!debug_locks)) {
+               printk("INFO: lockdep is turned off.\n");
+               return;
+       }
        printk("\nShowing all locks held in the system:\n");
 
        /*
@@ -2785,6 +2788,10 @@ EXPORT_SYMBOL_GPL(debug_show_all_locks);
 
 void debug_show_held_locks(struct task_struct *task)
 {
+       if (unlikely(!debug_locks)) {
+               printk("INFO: lockdep is turned off.\n");
+               return;
+       }
        lockdep_print_held_locks(task);
 }