[PATCH] generic BUG: printk "cut here" headers at appropriate levels

From: Paul Collins
Date: Mon Feb 09 2009 - 00:56:18 EST


Many machines, mine included, are configured to route syslog
messages at level "emerg" to all terminals. It seems kind of
silly to emit the least meaningful part of a BUG-style report at
the highest possible priority.

Signed-off-by: Paul Collins <paul@xxxxxxxxxxxxx>
---
lib/bug.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/bug.c b/lib/bug.c
index 300e41a..c35f4d8 100644
--- a/lib/bug.c
+++ b/lib/bug.c
@@ -136,8 +136,6 @@ enum bug_trap_type report_bug(unsigned long bugaddr, struct pt_regs *regs)

bug = find_bug(bugaddr);

- printk(KERN_EMERG "------------[ cut here ]------------\n");
-
file = NULL;
line = 0;
warning = 0;
@@ -156,6 +154,7 @@ enum bug_trap_type report_bug(unsigned long bugaddr, struct pt_regs *regs)

if (warning) {
/* this is a WARN_ON rather than BUG/BUG_ON */
+ printk(KERN_ERR "------------[ cut here ]------------\n");
if (file)
printk(KERN_ERR "Badness at %s:%u\n",
file, line);
@@ -169,6 +168,7 @@ enum bug_trap_type report_bug(unsigned long bugaddr, struct pt_regs *regs)
return BUG_TRAP_TYPE_WARN;
}

+ printk(KERN_CRIT "------------[ cut here ]------------\n");
if (file)
printk(KERN_CRIT "kernel BUG at %s:%u!\n",
file, line);

--
Paul Collins
Wellington, New Zealand

Dag vijandelijk luchtschip de huismeester is dood
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/