History

debug warnings: print the DMI board info name in a WARN/WARN_ON

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.

Arjan van de Ven committed 17 years ago

Commit bd89bb21 parent 74853db1 file · +6 −0Browse files

Showing the changes to kernel/panic.c (1 of 1 file). Show all

Unified · Split

kernel/panic.c+6−0
@@ -21,6 +21,7 @@ · 20 unmodified lines
2121 #include <linux/debug_locks.h>
2222 #include <linux/random.h>
2323 #include <linux/kallsyms.h>
24+#include <linux/dmi.h>
2425
2526 int panic_on_oops;
2627 static unsigned long tainted_mask;
@@ -325,11 +326,16 @@ void warn_slowpath(const char *file, int line, const char *fmt, ...) · 298 unmodified lines
325326 va_list args;
326327 char function[KSYM_SYMBOL_LEN];
327328 unsigned long caller = (unsigned long)__builtin_return_address(0);
329+ const char *board;
330+
328331 sprint_symbol(function, caller);
329332
330333 printk(KERN_WARNING "------------[ cut here ]------------\n");
331334 printk(KERN_WARNING "WARNING: at %s:%d %s()\n", file,
332335 line, function);
336+ board = dmi_get_system_info(DMI_PRODUCT_NAME);
337+ if (board)
338+ printk(KERN_WARNING "Hardware name: %s\n", board);
333339
334340 if (fmt) {
335341 va_start(args, fmt);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t