Skip to content

Commit

Permalink
x86: printk kernel version in WARN_ON and other dump_stack users
Browse files Browse the repository at this point in the history
today, all oopses contain a version number of the kernel, which is nice
because the people who actually do bother to read the oops get this
vital bit of information always without having to ask the reporter in
another round trip.

However, WARN_ON() and many other dump_stack() users right now lack this
information; the patch below adds this. This information is essential
for getting people to use their time effectively when looking at these
things; in addition, it's essential for tools that try to collect
statistics about defects.

Please consider, since its so simple and important for long term kernel
quality processes.

The code is identical between 32/64 bit; a lot of this code should be
unified over time, the patch keeps the identical-ness intact.

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
  • Loading branch information
Arjan van de Ven authored and Ingo Molnar committed Nov 26, 2007
1 parent c1c3063 commit 57c351d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions arch/x86/kernel/traps_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,11 @@ void dump_stack(void)
{
unsigned long stack;

printk("Pid: %d, comm: %.20s %s %s %.*s\n",
current->pid, current->comm, print_tainted(),
init_utsname()->release,
(int)strcspn(init_utsname()->version, " "),
init_utsname()->version);
show_trace(current, NULL, &stack);
}

Expand Down
7 changes: 7 additions & 0 deletions arch/x86/kernel/traps_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include <linux/uaccess.h>
#include <linux/bug.h>
#include <linux/kdebug.h>
#include <linux/utsname.h>

#if defined(CONFIG_EDAC)
#include <linux/edac.h>
Expand Down Expand Up @@ -400,6 +401,12 @@ void show_stack(struct task_struct *tsk, unsigned long * rsp)
void dump_stack(void)
{
unsigned long dummy;

printk("Pid: %d, comm: %.20s %s %s %.*s\n",
current->pid, current->comm, print_tainted(),
init_utsname()->release,
(int)strcspn(init_utsname()->version, " "),
init_utsname()->version);
show_trace(NULL, NULL, &dummy);
}

Expand Down

0 comments on commit 57c351d

Please sign in to comment.