aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/panic.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/panic.c')
-rw-r--r--kernel/panic.c29
1 files changed, 26 insertions, 3 deletions
diff --git a/kernel/panic.c b/kernel/panic.c
index da4d6bac270e..d9e90cfe3298 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -20,6 +20,7 @@
20#include <linux/kexec.h> 20#include <linux/kexec.h>
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 24
24int panic_on_oops; 25int panic_on_oops;
25int tainted; 26int tainted;
@@ -280,6 +281,13 @@ static int init_oops_id(void)
280} 281}
281late_initcall(init_oops_id); 282late_initcall(init_oops_id);
282 283
284static void print_oops_end_marker(void)
285{
286 init_oops_id();
287 printk(KERN_WARNING "---[ end trace %016llx ]---\n",
288 (unsigned long long)oops_id);
289}
290
283/* 291/*
284 * Called when the architecture exits its oops handler, after printing 292 * Called when the architecture exits its oops handler, after printing
285 * everything. 293 * everything.
@@ -287,11 +295,26 @@ late_initcall(init_oops_id);
287void oops_exit(void) 295void oops_exit(void)
288{ 296{
289 do_oops_enter_exit(); 297 do_oops_enter_exit();
290 init_oops_id(); 298 print_oops_end_marker();
291 printk(KERN_WARNING "---[ end trace %016llx ]---\n",
292 (unsigned long long)oops_id);
293} 299}
294 300
301#ifdef WANT_WARN_ON_SLOWPATH
302void warn_on_slowpath(const char *file, int line)
303{
304 char function[KSYM_SYMBOL_LEN];
305 unsigned long caller = (unsigned long) __builtin_return_address(0);
306 sprint_symbol(function, caller);
307
308 printk(KERN_WARNING "------------[ cut here ]------------\n");
309 printk(KERN_WARNING "WARNING: at %s:%d %s()\n", file,
310 line, function);
311 print_modules();
312 dump_stack();
313 print_oops_end_marker();
314}
315EXPORT_SYMBOL(warn_on_slowpath);
316#endif
317
295#ifdef CONFIG_CC_STACKPROTECTOR 318#ifdef CONFIG_CC_STACKPROTECTOR
296/* 319/*
297 * Called when gcc's -fstack-protector feature is used, and 320 * Called when gcc's -fstack-protector feature is used, and