[lkml]   [2006]   [Nov]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
SubjectRe: [patch] lockdep: show held locks when showing a stackdump

* Ingo Molnar <> wrote:

> Subject: [patch] lockdep: show held locks when showing a stackdump
> From: Ingo Molnar <>
> 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'.


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);
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at
 \ /
  Last update: 2006-11-16 15:05    [W:0.029 / U:2.352 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site