Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] make bug messages more consistent

Consolidate all kernel bug printouts to begin with the "BUG: " string.
Makes it easier to find them in large bootup logs.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Ingo Molnar and committed by
Linus Torvalds
91368d73 3257545e

+7 -7
+1 -1
arch/i386/kernel/nmi.c
··· 543 543 /* 544 544 * die_nmi will return ONLY if NOTIFY_STOP happens.. 545 545 */ 546 - die_nmi(regs, "NMI Watchdog detected LOCKUP"); 546 + die_nmi(regs, "BUG: NMI Watchdog detected LOCKUP"); 547 547 } else { 548 548 last_irq_sums[cpu] = sum; 549 549 alert_counter[cpu] = 0;
+2 -2
arch/i386/mm/fault.c
··· 518 518 } 519 519 #endif 520 520 if (address < PAGE_SIZE) 521 - printk(KERN_ALERT "Unable to handle kernel NULL pointer dereference"); 521 + printk(KERN_ALERT "BUG: unable to handle kernel NULL pointer dereference"); 522 522 else 523 - printk(KERN_ALERT "Unable to handle kernel paging request"); 523 + printk(KERN_ALERT "BUG: unable to handle kernel paging request"); 524 524 printk(" at virtual address %08lx\n",address); 525 525 printk(KERN_ALERT " printing eip:\n"); 526 526 printk("%08lx\n", regs->eip);
+2 -2
include/asm-generic/bug.h
··· 7 7 #ifdef CONFIG_BUG 8 8 #ifndef HAVE_ARCH_BUG 9 9 #define BUG() do { \ 10 - printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \ 10 + printk("BUG: failure at %s:%d/%s()!\n", __FILE__, __LINE__, __FUNCTION__); \ 11 11 panic("BUG!"); \ 12 12 } while (0) 13 13 #endif ··· 19 19 #ifndef HAVE_ARCH_WARN_ON 20 20 #define WARN_ON(condition) do { \ 21 21 if (unlikely((condition)!=0)) { \ 22 - printk("Badness in %s at %s:%d\n", __FUNCTION__, __FILE__, __LINE__); \ 22 + printk("BUG: warning at %s:%d/%s()\n", __FILE__, __LINE__, __FUNCTION__); \ 23 23 dump_stack(); \ 24 24 } \ 25 25 } while (0)
+2 -2
kernel/sched.c
··· 2873 2873 */ 2874 2874 if (likely(!current->exit_state)) { 2875 2875 if (unlikely(in_atomic())) { 2876 - printk(KERN_ERR "scheduling while atomic: " 2876 + printk(KERN_ERR "BUG: scheduling while atomic: " 2877 2877 "%s/0x%08x/%d\n", 2878 2878 current->comm, preempt_count(), current->pid); 2879 2879 dump_stack(); ··· 6074 6074 if (time_before(jiffies, prev_jiffy + HZ) && prev_jiffy) 6075 6075 return; 6076 6076 prev_jiffy = jiffies; 6077 - printk(KERN_ERR "Debug: sleeping function called from invalid" 6077 + printk(KERN_ERR "BUG: sleeping function called from invalid" 6078 6078 " context at %s:%d\n", file, line); 6079 6079 printk("in_atomic():%d, irqs_disabled():%d\n", 6080 6080 in_atomic(), irqs_disabled());