aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/panic.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/panic.c')
-rw-r--r--kernel/panic.c34
1 files changed, 14 insertions, 20 deletions
diff --git a/kernel/panic.c b/kernel/panic.c
index 4d5088355bfe..2a2ff36ff44d 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
25int panic_on_oops; 26int panic_on_oops;
26static unsigned long tainted_mask; 27static unsigned long tainted_mask;
@@ -298,6 +299,8 @@ static int init_oops_id(void)
298{ 299{
299 if (!oops_id) 300 if (!oops_id)
300 get_random_bytes(&oops_id, sizeof(oops_id)); 301 get_random_bytes(&oops_id, sizeof(oops_id));
302 else
303 oops_id++;
301 304
302 return 0; 305 return 0;
303} 306}
@@ -321,36 +324,27 @@ void oops_exit(void)
321} 324}
322 325
323#ifdef WANT_WARN_ON_SLOWPATH 326#ifdef WANT_WARN_ON_SLOWPATH
324void warn_on_slowpath(const char *file, int line)
325{
326 char function[KSYM_SYMBOL_LEN];
327 unsigned long caller = (unsigned long) __builtin_return_address(0);
328 sprint_symbol(function, caller);
329
330 printk(KERN_WARNING "------------[ cut here ]------------\n");
331 printk(KERN_WARNING "WARNING: at %s:%d %s()\n", file,
332 line, function);
333 print_modules();
334 dump_stack();
335 print_oops_end_marker();
336 add_taint(TAINT_WARN);
337}
338EXPORT_SYMBOL(warn_on_slowpath);
339
340
341void warn_slowpath(const char *file, int line, const char *fmt, ...) 327void warn_slowpath(const char *file, int line, const char *fmt, ...)
342{ 328{
343 va_list args; 329 va_list args;
344 char function[KSYM_SYMBOL_LEN]; 330 char function[KSYM_SYMBOL_LEN];
345 unsigned long caller = (unsigned long)__builtin_return_address(0); 331 unsigned long caller = (unsigned long)__builtin_return_address(0);
332 const char *board;
333
346 sprint_symbol(function, caller); 334 sprint_symbol(function, caller);
347 335
348 printk(KERN_WARNING "------------[ cut here ]------------\n"); 336 printk(KERN_WARNING "------------[ cut here ]------------\n");
349 printk(KERN_WARNING "WARNING: at %s:%d %s()\n", file, 337 printk(KERN_WARNING "WARNING: at %s:%d %s()\n", file,
350 line, function); 338 line, function);
351 va_start(args, fmt); 339 board = dmi_get_system_info(DMI_PRODUCT_NAME);
352 vprintk(fmt, args); 340 if (board)
353 va_end(args); 341 printk(KERN_WARNING "Hardware name: %s\n", board);
342
343 if (fmt) {
344 va_start(args, fmt);
345 vprintk(fmt, args);
346 va_end(args);
347 }
354 348
355 print_modules(); 349 print_modules();
356 dump_stack(); 350 dump_stack();