]> err.no Git - linux-2.6/commitdiff
[PATCH] lockdep: improve debug output
authorArjan van de Ven <arjan@Linux.intel.com>
Mon, 10 Jul 2006 11:44:03 +0000 (04:44 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Mon, 10 Jul 2006 20:24:14 +0000 (13:24 -0700)
Make lockdep print which lock is held, in the "kfree() of a live lock"
scenario.

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
kernel/lockdep.c

index 42af5cc31a49b6aba0c6a8092a852da25ed1f744..c1f34addd003d73e3b90189afc1d7410f88d46c3 100644 (file)
@@ -2551,7 +2551,7 @@ static inline int in_range(const void *start, const void *addr, const void *end)
 
 static void
 print_freed_lock_bug(struct task_struct *curr, const void *mem_from,
-                    const void *mem_to)
+                    const void *mem_to, struct held_lock *hlock)
 {
        if (!debug_locks_off())
                return;
@@ -2563,6 +2563,7 @@ print_freed_lock_bug(struct task_struct *curr, const void *mem_from,
        printk(  "-------------------------\n");
        printk("%s/%d is freeing memory %p-%p, with a lock still held there!\n",
                curr->comm, curr->pid, mem_from, mem_to-1);
+       print_lock(hlock);
        lockdep_print_held_locks(curr);
 
        printk("\nstack backtrace:\n");
@@ -2596,7 +2597,7 @@ void debug_check_no_locks_freed(const void *mem_from, unsigned long mem_len)
                                        !in_range(mem_from, lock_to, mem_to))
                        continue;
 
-               print_freed_lock_bug(curr, mem_from, mem_to);
+               print_freed_lock_bug(curr, mem_from, mem_to, hlock);
                break;
        }
        local_irq_restore(flags);