Skip to content

Commit

Permalink
debug warnings: print the DMI board info name in a WARN/WARN_ON
Browse files Browse the repository at this point in the history
Impact: extend WARN_ON() output with DMI_PRODUCT_NAME

It's very useful for many low level WARN_ON's to find out which
motherboard has the broken BIOS etc... this patch adds a printk
to the WARN_ON code for this.

On architectures without DMI, gcc should optimize the code out.

Signed-off-by: Arjan van de Ven <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
  • Loading branch information
fenrus75 authored and Ingo Molnar committed Nov 28, 2008
1 parent 74853db commit bd89bb2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions kernel/panic.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <linux/debug_locks.h>
#include <linux/random.h>
#include <linux/kallsyms.h>
#include <linux/dmi.h>

int panic_on_oops;
static unsigned long tainted_mask;
Expand Down Expand Up @@ -325,11 +326,16 @@ void warn_slowpath(const char *file, int line, const char *fmt, ...)
va_list args;
char function[KSYM_SYMBOL_LEN];
unsigned long caller = (unsigned long)__builtin_return_address(0);
const char *board;

sprint_symbol(function, caller);

printk(KERN_WARNING "------------[ cut here ]------------\n");
printk(KERN_WARNING "WARNING: at %s:%d %s()\n", file,
line, function);
board = dmi_get_system_info(DMI_PRODUCT_NAME);
if (board)
printk(KERN_WARNING "Hardware name: %s\n", board);

if (fmt) {
va_start(args, fmt);
Expand Down

0 comments on commit bd89bb2

Please sign in to comment.