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 | |
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>
-rw-r--r-- | arch/x86/kernel/traps_32.c | 17 | ||||
-rw-r--r-- | arch/x86/mm/fault_32.c | 13 |
2 files changed, 12 insertions, 18 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) { |
diff --git a/arch/x86/mm/fault_32.c b/arch/x86/mm/fault_32.c index c686ae20fd6b..d84314ce22bb 100644 --- a/arch/x86/mm/fault_32.c +++ b/arch/x86/mm/fault_32.c | |||
@@ -539,23 +539,22 @@ no_context: | |||
539 | printk(KERN_ALERT "BUG: unable to handle kernel paging" | 539 | printk(KERN_ALERT "BUG: unable to handle kernel paging" |
540 | " request"); | 540 | " request"); |
541 | printk(" at virtual address %08lx\n",address); | 541 | printk(" at virtual address %08lx\n",address); |
542 | printk(KERN_ALERT " printing eip:\n"); | 542 | printk(KERN_ALERT "printing eip: %08lx ", regs->eip); |
543 | printk("%08lx\n", regs->eip); | ||
544 | 543 | ||
545 | page = read_cr3(); | 544 | page = read_cr3(); |
546 | page = ((__typeof__(page) *) __va(page))[address >> PGDIR_SHIFT]; | 545 | page = ((__typeof__(page) *) __va(page))[address >> PGDIR_SHIFT]; |
547 | #ifdef CONFIG_X86_PAE | 546 | #ifdef CONFIG_X86_PAE |
548 | printk(KERN_ALERT "*pdpt = %016Lx\n", page); | 547 | printk("*pdpt = %016Lx ", page); |
549 | if ((page >> PAGE_SHIFT) < max_low_pfn | 548 | if ((page >> PAGE_SHIFT) < max_low_pfn |
550 | && page & _PAGE_PRESENT) { | 549 | && page & _PAGE_PRESENT) { |
551 | page &= PAGE_MASK; | 550 | page &= PAGE_MASK; |
552 | page = ((__typeof__(page) *) __va(page))[(address >> PMD_SHIFT) | 551 | page = ((__typeof__(page) *) __va(page))[(address >> PMD_SHIFT) |
553 | & (PTRS_PER_PMD - 1)]; | 552 | & (PTRS_PER_PMD - 1)]; |
554 | printk(KERN_ALERT "*pde = %016Lx\n", page); | 553 | printk(KERN_ALERT "*pde = %016Lx ", page); |
555 | page &= ~_PAGE_NX; | 554 | page &= ~_PAGE_NX; |
556 | } | 555 | } |
557 | #else | 556 | #else |
558 | printk(KERN_ALERT "*pde = %08lx\n", page); | 557 | printk("*pde = %08lx ", page); |
559 | #endif | 558 | #endif |
560 | 559 | ||
561 | /* | 560 | /* |
@@ -569,8 +568,10 @@ no_context: | |||
569 | page &= PAGE_MASK; | 568 | page &= PAGE_MASK; |
570 | page = ((__typeof__(page) *) __va(page))[(address >> PAGE_SHIFT) | 569 | page = ((__typeof__(page) *) __va(page))[(address >> PAGE_SHIFT) |
571 | & (PTRS_PER_PTE - 1)]; | 570 | & (PTRS_PER_PTE - 1)]; |
572 | printk(KERN_ALERT "*pte = %0*Lx\n", sizeof(page)*2, (u64)page); | 571 | printk("*pte = %0*Lx ", sizeof(page)*2, (u64)page); |
573 | } | 572 | } |
573 | |||
574 | printk("\n"); | ||
574 | } | 575 | } |
575 | 576 | ||
576 | tsk->thread.cr2 = address; | 577 | tsk->thread.cr2 = address; |