Commit 91368d73 authored by Ingo Molnar's avatar Ingo Molnar Committed by Linus Torvalds

[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: default avatarIngo Molnar <mingo@elte.hu>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 3257545e
...@@ -543,7 +543,7 @@ void nmi_watchdog_tick (struct pt_regs * regs) ...@@ -543,7 +543,7 @@ void nmi_watchdog_tick (struct pt_regs * regs)
/* /*
* die_nmi will return ONLY if NOTIFY_STOP happens.. * die_nmi will return ONLY if NOTIFY_STOP happens..
*/ */
die_nmi(regs, "NMI Watchdog detected LOCKUP"); die_nmi(regs, "BUG: NMI Watchdog detected LOCKUP");
} else { } else {
last_irq_sums[cpu] = sum; last_irq_sums[cpu] = sum;
alert_counter[cpu] = 0; alert_counter[cpu] = 0;
......
...@@ -518,9 +518,9 @@ no_context: ...@@ -518,9 +518,9 @@ no_context:
} }
#endif #endif
if (address < PAGE_SIZE) if (address < PAGE_SIZE)
printk(KERN_ALERT "Unable to handle kernel NULL pointer dereference"); printk(KERN_ALERT "BUG: unable to handle kernel NULL pointer dereference");
else else
printk(KERN_ALERT "Unable to handle kernel paging request"); printk(KERN_ALERT "BUG: unable to handle kernel paging request");
printk(" at virtual address %08lx\n",address); printk(" at virtual address %08lx\n",address);
printk(KERN_ALERT " printing eip:\n"); printk(KERN_ALERT " printing eip:\n");
printk("%08lx\n", regs->eip); printk("%08lx\n", regs->eip);
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#ifdef CONFIG_BUG #ifdef CONFIG_BUG
#ifndef HAVE_ARCH_BUG #ifndef HAVE_ARCH_BUG
#define BUG() do { \ #define BUG() do { \
printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \ printk("BUG: failure at %s:%d/%s()!\n", __FILE__, __LINE__, __FUNCTION__); \
panic("BUG!"); \ panic("BUG!"); \
} while (0) } while (0)
#endif #endif
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#ifndef HAVE_ARCH_WARN_ON #ifndef HAVE_ARCH_WARN_ON
#define WARN_ON(condition) do { \ #define WARN_ON(condition) do { \
if (unlikely((condition)!=0)) { \ if (unlikely((condition)!=0)) { \
printk("Badness in %s at %s:%d\n", __FUNCTION__, __FILE__, __LINE__); \ printk("BUG: warning at %s:%d/%s()\n", __FILE__, __LINE__, __FUNCTION__); \
dump_stack(); \ dump_stack(); \
} \ } \
} while (0) } while (0)
......
...@@ -2873,7 +2873,7 @@ asmlinkage void __sched schedule(void) ...@@ -2873,7 +2873,7 @@ asmlinkage void __sched schedule(void)
*/ */
if (likely(!current->exit_state)) { if (likely(!current->exit_state)) {
if (unlikely(in_atomic())) { if (unlikely(in_atomic())) {
printk(KERN_ERR "scheduling while atomic: " printk(KERN_ERR "BUG: scheduling while atomic: "
"%s/0x%08x/%d\n", "%s/0x%08x/%d\n",
current->comm, preempt_count(), current->pid); current->comm, preempt_count(), current->pid);
dump_stack(); dump_stack();
...@@ -6074,7 +6074,7 @@ void __might_sleep(char *file, int line) ...@@ -6074,7 +6074,7 @@ void __might_sleep(char *file, int line)
if (time_before(jiffies, prev_jiffy + HZ) && prev_jiffy) if (time_before(jiffies, prev_jiffy + HZ) && prev_jiffy)
return; return;
prev_jiffy = jiffies; prev_jiffy = jiffies;
printk(KERN_ERR "Debug: sleeping function called from invalid" printk(KERN_ERR "BUG: sleeping function called from invalid"
" context at %s:%d\n", file, line); " context at %s:%d\n", file, line);
printk("in_atomic():%d, irqs_disabled():%d\n", printk("in_atomic():%d, irqs_disabled():%d\n",
in_atomic(), irqs_disabled()); in_atomic(), irqs_disabled());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment