Commit 99de055a authored by Dave Jones's avatar Dave Jones Committed by Linus Torvalds

[PATCH] lockdep: print kernel version

Lets do the same thing we do for oopses - print out the version in the
report.  It's an extra line of output though.  We could tack it on the end
of the INFO: lines, but that screws up Ingo's pretty output.
Signed-off-by: default avatarDave Jones <davej@redhat.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 2b33b4dc
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
#include <linux/stacktrace.h> #include <linux/stacktrace.h>
#include <linux/debug_locks.h> #include <linux/debug_locks.h>
#include <linux/irqflags.h> #include <linux/irqflags.h>
#include <linux/utsname.h>
#include <asm/sections.h> #include <asm/sections.h>
...@@ -515,6 +516,13 @@ print_circular_bug_entry(struct lock_list *target, unsigned int depth) ...@@ -515,6 +516,13 @@ print_circular_bug_entry(struct lock_list *target, unsigned int depth)
return 0; return 0;
} }
static void print_kernel_version(void)
{
printk("%s %.*s\n", system_utsname.release,
(int)strcspn(system_utsname.version, " "),
system_utsname.version);
}
/* /*
* When a circular dependency is detected, print the * When a circular dependency is detected, print the
* header first: * header first:
...@@ -531,6 +539,7 @@ print_circular_bug_header(struct lock_list *entry, unsigned int depth) ...@@ -531,6 +539,7 @@ print_circular_bug_header(struct lock_list *entry, unsigned int depth)
printk("\n=======================================================\n"); printk("\n=======================================================\n");
printk( "[ INFO: possible circular locking dependency detected ]\n"); printk( "[ INFO: possible circular locking dependency detected ]\n");
print_kernel_version();
printk( "-------------------------------------------------------\n"); printk( "-------------------------------------------------------\n");
printk("%s/%d is trying to acquire lock:\n", printk("%s/%d is trying to acquire lock:\n",
curr->comm, curr->pid); curr->comm, curr->pid);
...@@ -712,6 +721,7 @@ print_bad_irq_dependency(struct task_struct *curr, ...@@ -712,6 +721,7 @@ print_bad_irq_dependency(struct task_struct *curr,
printk("\n======================================================\n"); printk("\n======================================================\n");
printk( "[ INFO: %s-safe -> %s-unsafe lock order detected ]\n", printk( "[ INFO: %s-safe -> %s-unsafe lock order detected ]\n",
irqclass, irqclass); irqclass, irqclass);
print_kernel_version();
printk( "------------------------------------------------------\n"); printk( "------------------------------------------------------\n");
printk("%s/%d [HC%u[%lu]:SC%u[%lu]:HE%u:SE%u] is trying to acquire:\n", printk("%s/%d [HC%u[%lu]:SC%u[%lu]:HE%u:SE%u] is trying to acquire:\n",
curr->comm, curr->pid, curr->comm, curr->pid,
...@@ -793,6 +803,7 @@ print_deadlock_bug(struct task_struct *curr, struct held_lock *prev, ...@@ -793,6 +803,7 @@ print_deadlock_bug(struct task_struct *curr, struct held_lock *prev,
printk("\n=============================================\n"); printk("\n=============================================\n");
printk( "[ INFO: possible recursive locking detected ]\n"); printk( "[ INFO: possible recursive locking detected ]\n");
print_kernel_version();
printk( "---------------------------------------------\n"); printk( "---------------------------------------------\n");
printk("%s/%d is trying to acquire lock:\n", printk("%s/%d is trying to acquire lock:\n",
curr->comm, curr->pid); curr->comm, curr->pid);
...@@ -1375,6 +1386,7 @@ print_irq_inversion_bug(struct task_struct *curr, struct lock_class *other, ...@@ -1375,6 +1386,7 @@ print_irq_inversion_bug(struct task_struct *curr, struct lock_class *other,
printk("\n=========================================================\n"); printk("\n=========================================================\n");
printk( "[ INFO: possible irq lock inversion dependency detected ]\n"); printk( "[ INFO: possible irq lock inversion dependency detected ]\n");
print_kernel_version();
printk( "---------------------------------------------------------\n"); printk( "---------------------------------------------------------\n");
printk("%s/%d just changed the state of lock:\n", printk("%s/%d just changed the state of lock:\n",
curr->comm, curr->pid); curr->comm, curr->pid);
...@@ -1469,6 +1481,7 @@ print_usage_bug(struct task_struct *curr, struct held_lock *this, ...@@ -1469,6 +1481,7 @@ print_usage_bug(struct task_struct *curr, struct held_lock *this,
printk("\n=================================\n"); printk("\n=================================\n");
printk( "[ INFO: inconsistent lock state ]\n"); printk( "[ INFO: inconsistent lock state ]\n");
print_kernel_version();
printk( "---------------------------------\n"); printk( "---------------------------------\n");
printk("inconsistent {%s} -> {%s} usage.\n", printk("inconsistent {%s} -> {%s} usage.\n",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment