From: Andi Kleen Often users only report what syslogd reports with KERN_ALERT when a kernel crash occurs. Make an oops print mpre information with that (in particular the RIP) Patch for i386 and x86-64. Signed-off-by: Andrew Morton --- 25-akpm/arch/i386/kernel/traps.c | 4 ++-- 25-akpm/arch/i386/mm/fault.c | 2 +- 25-akpm/arch/x86_64/kernel/traps.c | 4 ++-- 25-akpm/arch/x86_64/mm/fault.c | 3 ++- 4 files changed, 7 insertions(+), 6 deletions(-) diff -puN arch/i386/kernel/traps.c~use-kern_alert-more-for-oopses arch/i386/kernel/traps.c --- 25/arch/i386/kernel/traps.c~use-kern_alert-more-for-oopses 2004-06-02 18:03:19.828502912 -0700 +++ 25-akpm/arch/i386/kernel/traps.c 2004-06-02 18:03:19.836501696 -0700 @@ -319,7 +319,7 @@ static void handle_BUG(struct pt_regs *r file = ""; printk("------------[ cut here ]------------\n"); - printk("kernel BUG at %s:%d!\n", file, line); + printk(KERN_ALERT "kernel BUG at %s:%d!\n", file, line); no_bug: return; @@ -340,7 +340,7 @@ void die(const char * str, struct pt_reg spin_lock_irq(&die_lock); bust_spinlocks(1); handle_BUG(regs); - printk("%s: %04lx [#%d]\n", str, err & 0xffff, ++die_counter); + printk(KERN_ALERT "%s: %04lx [#%d]\n", str, err & 0xffff, ++die_counter); #ifdef CONFIG_PREEMPT printk("PREEMPT "); nl = 1; diff -puN arch/i386/mm/fault.c~use-kern_alert-more-for-oopses arch/i386/mm/fault.c --- 25/arch/i386/mm/fault.c~use-kern_alert-more-for-oopses 2004-06-02 18:03:19.829502760 -0700 +++ 25-akpm/arch/i386/mm/fault.c 2004-06-02 18:03:19.837501544 -0700 @@ -451,7 +451,7 @@ no_context: else printk(KERN_ALERT "Unable to handle kernel paging request"); printk(" at virtual address %08lx\n",address); - printk(" printing eip:\n"); + printk(KERN_ALERT " printing eip:\n"); printk("%08lx\n", regs->eip); asm("movl %%cr3,%0":"=r" (page)); page = ((unsigned long *) __va(page))[address >> 22]; diff -puN arch/x86_64/kernel/traps.c~use-kern_alert-more-for-oopses arch/x86_64/kernel/traps.c --- 25/arch/x86_64/kernel/traps.c~use-kern_alert-more-for-oopses 2004-06-02 18:03:19.831502456 -0700 +++ 25-akpm/arch/x86_64/kernel/traps.c 2004-06-02 18:03:19.838501392 -0700 @@ -305,7 +305,7 @@ void handle_BUG(struct pt_regs *regs) if (__get_user(tmp, f.filename)) f.filename = "unmapped filename"; printk("----------- [cut here ] --------- [please bite here ] ---------\n"); - printk("Kernel BUG at %.50s:%d\n", f.filename, f.line); + printk(KERN_ALERT "Kernel BUG at %.50s:%d\n", f.filename, f.line); } void out_of_line_bug(void) @@ -359,7 +359,7 @@ void __die(const char * str, struct pt_r notify_die(DIE_OOPS, (char *)str, regs, err, 255, SIGSEGV); show_registers(regs); /* Executive summary in case the oops scrolled away */ - printk("RIP "); + printk(KERN_ALERT "RIP "); printk_address(regs->rip); printk(" RSP <%016lx>\n", regs->rsp); } diff -puN arch/x86_64/mm/fault.c~use-kern_alert-more-for-oopses arch/x86_64/mm/fault.c --- 25/arch/x86_64/mm/fault.c~use-kern_alert-more-for-oopses 2004-06-02 18:03:19.833502152 -0700 +++ 25-akpm/arch/x86_64/mm/fault.c 2004-06-02 18:03:19.838501392 -0700 @@ -423,8 +423,9 @@ no_context: printk(KERN_ALERT "Unable to handle kernel NULL pointer dereference"); else printk(KERN_ALERT "Unable to handle kernel paging request"); - printk(" at %016lx RIP: \n",address); + printk(" at %016lx RIP: \n" KERN_ALERT,address); printk_address(regs->rip); + printk("\n"); dump_pagetable(address); __die("Oops", regs, error_code); /* Executive summary in case the body of the oops scrolled away */ _