lockdep: show held locks when showing a stackdump
PATCH 1/1 lockdep: show held locks when showing a stackdump
Subject: [patch] lockdep: show held locks when showing a stackdump
From: Ingo Molnar <[email protected]>
lockdep can be used to print held locks when printing a backtrace. This can be useful when debugging things like 'scheduling while atomic' asserts.
Signed-off-by Ingo Molnar <[email protected]>
--- arch/i386/kernel/traps.c | 1 + arch/x86_64/kernel/traps.c | 1 + 2 files changed, 2 insertions(+)
arch/i386/kernel/traps.c +1 -0
@@ -318,6 +318,7 @@ static void show_stack_log_lvl(struct ta }printk ("\n%sCall Trace:\n" , log_lvl);show_trace_log_lvl (task, regs, esp, log_lvl); +debug_show_held_locks (task); }void show_stack (struct task_struct *task,unsigned long *esp)
arch/x86_64/kernel/traps.c +1 -0
@@ -405,6 +405,7 @@ show_trace(struct task_struct *tsk, struprintk ("\nCall Trace:\n" );dump_trace (tsk, regs, stack, &print_trace_ops,NULL );printk ("\n" ); +debug_show_held_locks (tsk); } static void
Quoted 6 lines · Ingo Molnar
Subject: [patch] lockdep: show held locks when showing a stackdump
From: Ingo Molnar <[email protected]>lockdep can be used to print held locks when printing a backtrace. This can be useful when debugging things like 'scheduling while atomic' asserts.
on x86_64 this also needs the patch below - NULL means 'current'.
Ingo
kernel/lockdep.c +5 -1
@@ -395,7 +395,11 @@ static void print_lock(struct held_lockstatic void lockdep_print_held_locks (struct task_struct *curr) { -int i, depth = curr->lockdep_depth; +int i, depth; + +if (!curr) + curr = current; + depth = curr->lockdep_depth;if (!depth) {printk ("no locks held by %s/%d.\n" , curr->comm, curr->pid);