diff options
Diffstat (limited to 'kernel/panic.c')
-rw-r--r-- | kernel/panic.c | 33 |
1 files changed, 13 insertions, 20 deletions
diff --git a/kernel/panic.c b/kernel/panic.c index 6513aac8e992..13f06349a786 100644 --- a/kernel/panic.c +++ b/kernel/panic.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <linux/debug_locks.h> | 21 | #include <linux/debug_locks.h> |
22 | #include <linux/random.h> | 22 | #include <linux/random.h> |
23 | #include <linux/kallsyms.h> | 23 | #include <linux/kallsyms.h> |
24 | #include <linux/dmi.h> | ||
24 | 25 | ||
25 | int panic_on_oops; | 26 | int panic_on_oops; |
26 | static unsigned long tainted_mask; | 27 | static unsigned long tainted_mask; |
@@ -167,6 +168,7 @@ static const struct tnt tnts[] = { | |||
167 | * 'M' - System experienced a machine check exception. | 168 | * 'M' - System experienced a machine check exception. |
168 | * 'B' - System has hit bad_page. | 169 | * 'B' - System has hit bad_page. |
169 | * 'U' - Userspace-defined naughtiness. | 170 | * 'U' - Userspace-defined naughtiness. |
171 | * 'D' - Kernel has oopsed before | ||
170 | * 'A' - ACPI table overridden. | 172 | * 'A' - ACPI table overridden. |
171 | * 'W' - Taint on warning. | 173 | * 'W' - Taint on warning. |
172 | * 'C' - modules from drivers/staging are loaded. | 174 | * 'C' - modules from drivers/staging are loaded. |
@@ -320,36 +322,27 @@ void oops_exit(void) | |||
320 | } | 322 | } |
321 | 323 | ||
322 | #ifdef WANT_WARN_ON_SLOWPATH | 324 | #ifdef WANT_WARN_ON_SLOWPATH |
323 | void warn_on_slowpath(const char *file, int line) | ||
324 | { | ||
325 | char function[KSYM_SYMBOL_LEN]; | ||
326 | unsigned long caller = (unsigned long) __builtin_return_address(0); | ||
327 | sprint_symbol(function, caller); | ||
328 | |||
329 | printk(KERN_WARNING "------------[ cut here ]------------\n"); | ||
330 | printk(KERN_WARNING "WARNING: at %s:%d %s()\n", file, | ||
331 | line, function); | ||
332 | print_modules(); | ||
333 | dump_stack(); | ||
334 | print_oops_end_marker(); | ||
335 | add_taint(TAINT_WARN); | ||
336 | } | ||
337 | EXPORT_SYMBOL(warn_on_slowpath); | ||
338 | |||
339 | |||
340 | void warn_slowpath(const char *file, int line, const char *fmt, ...) | 325 | void warn_slowpath(const char *file, int line, const char *fmt, ...) |
341 | { | 326 | { |
342 | va_list args; | 327 | va_list args; |
343 | char function[KSYM_SYMBOL_LEN]; | 328 | char function[KSYM_SYMBOL_LEN]; |
344 | unsigned long caller = (unsigned long)__builtin_return_address(0); | 329 | unsigned long caller = (unsigned long)__builtin_return_address(0); |
330 | const char *board; | ||
331 | |||
345 | sprint_symbol(function, caller); | 332 | sprint_symbol(function, caller); |
346 | 333 | ||
347 | printk(KERN_WARNING "------------[ cut here ]------------\n"); | 334 | printk(KERN_WARNING "------------[ cut here ]------------\n"); |
348 | printk(KERN_WARNING "WARNING: at %s:%d %s()\n", file, | 335 | printk(KERN_WARNING "WARNING: at %s:%d %s()\n", file, |
349 | line, function); | 336 | line, function); |
350 | va_start(args, fmt); | 337 | board = dmi_get_system_info(DMI_PRODUCT_NAME); |
351 | vprintk(fmt, args); | 338 | if (board) |
352 | va_end(args); | 339 | printk(KERN_WARNING "Hardware name: %s\n", board); |
340 | |||
341 | if (fmt) { | ||
342 | va_start(args, fmt); | ||
343 | vprintk(fmt, args); | ||
344 | va_end(args); | ||
345 | } | ||
353 | 346 | ||
354 | print_modules(); | 347 | print_modules(); |
355 | dump_stack(); | 348 | dump_stack(); |