* [patch] lockdep: show held locks when showing a stackdump
@ 2006-11-16 10:08 Ingo Molnar
2006-11-16 14:01 ` Ingo Molnar
0 siblings, 1 reply; 2+ messages in thread
From: Ingo Molnar @ 2006-11-16 10:08 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-kernel
Subject: [patch] lockdep: show held locks when showing a stackdump
From: Ingo Molnar <mingo@elte.hu>
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 <mingo@elte.hu>
---
arch/i386/kernel/traps.c | 1 +
arch/x86_64/kernel/traps.c | 1 +
2 files changed, 2 insertions(+)
Index: linux/arch/i386/kernel/traps.c
===================================================================
--- linux.orig/arch/i386/kernel/traps.c
+++ linux/arch/i386/kernel/traps.c
@@ -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)
Index: linux/arch/x86_64/kernel/traps.c
===================================================================
--- linux.orig/arch/x86_64/kernel/traps.c
+++ linux/arch/x86_64/kernel/traps.c
@@ -405,6 +405,7 @@ show_trace(struct task_struct *tsk, stru
printk("\nCall Trace:\n");
dump_trace(tsk, regs, stack, &print_trace_ops, NULL);
printk("\n");
+ debug_show_held_locks(tsk);
}
static void
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [patch] lockdep: show held locks when showing a stackdump
2006-11-16 10:08 [patch] lockdep: show held locks when showing a stackdump Ingo Molnar
@ 2006-11-16 14:01 ` Ingo Molnar
0 siblings, 0 replies; 2+ messages in thread
From: Ingo Molnar @ 2006-11-16 14:01 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-kernel
* Ingo Molnar <mingo@elte.hu> wrote:
> Subject: [patch] lockdep: show held locks when showing a stackdump
> From: Ingo Molnar <mingo@elte.hu>
>
> 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
Index: linux/kernel/lockdep.c
===================================================================
--- linux.orig/kernel/lockdep.c
+++ linux/kernel/lockdep.c
@@ -395,7 +395,11 @@ static void print_lock(struct held_lock
static 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);
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-11-16 14:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-11-16 10:08 [patch] lockdep: show held locks when showing a stackdump Ingo Molnar
2006-11-16 14:01 ` Ingo Molnar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®