diff options
author | Arjan van de Ven <arjan@linux.intel.com> | 2008-01-30 07:32:50 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-01-30 07:32:50 -0500 |
commit | 71c339116a216b181fc5e203ef51a033fe5e38cf (patch) | |
tree | d69ddfa6c980247a06fd9f096c116e94cf572e81 /kernel/panic.c | |
parent | 79b4cc5ee7a8086ac2c9c0afa52e6d687ce1ffef (diff) |
debug: add the end-of-trace marker and the module list to
Unlike oopses, WARN_ON() currently does't print the loaded modules list.
This makes it harder to take action on certain bug reports. For example,
recently there were a set of WARN_ON()s reported in the mac80211 stack,
which were just signalling a driver bug. It takes then anther round trip
to the bug reporter (if he responds at all) to find out which driver
is at fault.
Another issue is that, unlike oopses, WARN_ON() doesn't currently printk
the helpful "cut here" line, nor the "end of trace" marker.
Now that WARN_ON() is out of line, the size increase due to this is
minimal and it's worth adding.
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel/panic.c')
-rw-r--r-- | kernel/panic.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/kernel/panic.c b/kernel/panic.c index 0ebea438278a..d9e90cfe3298 100644 --- a/kernel/panic.c +++ b/kernel/panic.c | |||
@@ -281,6 +281,13 @@ static int init_oops_id(void) | |||
281 | } | 281 | } |
282 | late_initcall(init_oops_id); | 282 | late_initcall(init_oops_id); |
283 | 283 | ||
284 | static 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 | |||
284 | /* | 291 | /* |
285 | * Called when the architecture exits its oops handler, after printing | 292 | * Called when the architecture exits its oops handler, after printing |
286 | * everything. | 293 | * everything. |
@@ -288,9 +295,7 @@ late_initcall(init_oops_id); | |||
288 | void oops_exit(void) | 295 | void oops_exit(void) |
289 | { | 296 | { |
290 | do_oops_enter_exit(); | 297 | do_oops_enter_exit(); |
291 | init_oops_id(); | 298 | print_oops_end_marker(); |
292 | printk(KERN_WARNING "---[ end trace %016llx ]---\n", | ||
293 | (unsigned long long)oops_id); | ||
294 | } | 299 | } |
295 | 300 | ||
296 | #ifdef WANT_WARN_ON_SLOWPATH | 301 | #ifdef WANT_WARN_ON_SLOWPATH |
@@ -298,11 +303,14 @@ void warn_on_slowpath(const char *file, int line) | |||
298 | { | 303 | { |
299 | char function[KSYM_SYMBOL_LEN]; | 304 | char function[KSYM_SYMBOL_LEN]; |
300 | unsigned long caller = (unsigned long) __builtin_return_address(0); | 305 | unsigned long caller = (unsigned long) __builtin_return_address(0); |
301 | |||
302 | sprint_symbol(function, caller); | 306 | sprint_symbol(function, caller); |
307 | |||
308 | printk(KERN_WARNING "------------[ cut here ]------------\n"); | ||
303 | printk(KERN_WARNING "WARNING: at %s:%d %s()\n", file, | 309 | printk(KERN_WARNING "WARNING: at %s:%d %s()\n", file, |
304 | line, function); | 310 | line, function); |
311 | print_modules(); | ||
305 | dump_stack(); | 312 | dump_stack(); |
313 | print_oops_end_marker(); | ||
306 | } | 314 | } |
307 | EXPORT_SYMBOL(warn_on_slowpath); | 315 | EXPORT_SYMBOL(warn_on_slowpath); |
308 | #endif | 316 | #endif |