diff options
author | Pavel Emelyanov <xemul@openvz.org> | 2007-10-17 12:04:40 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@inhelltoy.tec.linutronix.de> | 2007-10-17 14:16:52 -0400 |
commit | 9aa8d7195acb18fc436847f6c66a97f8359ad54d (patch) | |
tree | dea6832422b478791007c49e8cc6ccd414d900e9 /arch/x86/kernel/traps_32.c | |
parent | c1e3619edd2b3e17450d745e27e335490cafd78d (diff) |
i386: clean up oops/bug reports
Typically the oops first lines look like this:
BUG: unable to handle kernel NULL pointer dereference at virtual address 00000000
printing eip:
c049dfbd
*pde = 00000000
Oops: 0002 [#1]
PREEMPT SMP
...
Such output is gained with some ugly if (!nl) printk("\n"); code and
besides being a waste of lines, this is also annoying to read. The
following output looks better (and it is how it looks on x86_64):
BUG: unable to handle kernel NULL pointer dereference at virtual address 00000000
printing eip: c049dfbd *pde = 00000000
Oops: 0002 [#1] PREEMPT SMP
...
[ tglx: arch/x86 adaptation ]
Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/kernel/traps_32.c')
-rw-r--r-- | arch/x86/kernel/traps_32.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/arch/x86/kernel/traps_32.c b/arch/x86/kernel/traps_32.c index 83a9bbbbe38f..b132d3957dfc 100644 --- a/arch/x86/kernel/traps_32.c +++ b/arch/x86/kernel/traps_32.c | |||
@@ -398,31 +398,24 @@ void die(const char * str, struct pt_regs * regs, long err) | |||
398 | local_save_flags(flags); | 398 | local_save_flags(flags); |
399 | 399 | ||
400 | if (++die.lock_owner_depth < 3) { | 400 | if (++die.lock_owner_depth < 3) { |
401 | int nl = 0; | ||
402 | unsigned long esp; | 401 | unsigned long esp; |
403 | unsigned short ss; | 402 | unsigned short ss; |
404 | 403 | ||
405 | report_bug(regs->eip, regs); | 404 | report_bug(regs->eip, regs); |
406 | 405 | ||
407 | printk(KERN_EMERG "%s: %04lx [#%d]\n", str, err & 0xffff, ++die_counter); | 406 | printk(KERN_EMERG "%s: %04lx [#%d] ", str, err & 0xffff, |
407 | ++die_counter); | ||
408 | #ifdef CONFIG_PREEMPT | 408 | #ifdef CONFIG_PREEMPT |
409 | printk(KERN_EMERG "PREEMPT "); | 409 | printk("PREEMPT "); |
410 | nl = 1; | ||
411 | #endif | 410 | #endif |
412 | #ifdef CONFIG_SMP | 411 | #ifdef CONFIG_SMP |
413 | if (!nl) | ||
414 | printk(KERN_EMERG); | ||
415 | printk("SMP "); | 412 | printk("SMP "); |
416 | nl = 1; | ||
417 | #endif | 413 | #endif |
418 | #ifdef CONFIG_DEBUG_PAGEALLOC | 414 | #ifdef CONFIG_DEBUG_PAGEALLOC |
419 | if (!nl) | ||
420 | printk(KERN_EMERG); | ||
421 | printk("DEBUG_PAGEALLOC"); | 415 | printk("DEBUG_PAGEALLOC"); |
422 | nl = 1; | ||
423 | #endif | 416 | #endif |
424 | if (nl) | 417 | printk("\n"); |
425 | printk("\n"); | 418 | |
426 | if (notify_die(DIE_OOPS, str, regs, err, | 419 | if (notify_die(DIE_OOPS, str, regs, err, |
427 | current->thread.trap_no, SIGSEGV) != | 420 | current->thread.trap_no, SIGSEGV) != |
428 | NOTIFY_STOP) { | 421 | NOTIFY_STOP) { |