Re: Top kernel oopses/warnings this week

From: Arjan van de Ven
Date: Tue Dec 18 2007 - 13:08:37 EST


Linus Torvalds wrote:

On Mon, 17 Dec 2007, Arjan van de Ven wrote:
+char *get_boot_uuid(void)
+{
+ static char target[38];
+ unsigned char *uuid;
+
+ if (sysctl_bootid[8] == 0)
+ generate_random_uuid(sysctl_bootid);
+ /* sysctl_bootid is signed, to print we need unsigned .. */
+ uuid = sysctl_bootid;
+
+ if (target[0] == 0) {
+ sprintf(target, "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-"
+ "%02x%02x%02x%02x%02x%02x",

Why isn't *everything* inside that "if (target[0] == 0" check?

IOW, that function should look something like


ok so this got a lot more involved than I was hoping for;
something like below will help me (and kerneloops.org ;) for the short term,
while I'll see what I can do for random.c in a few dead moments soon, for a 2.6.25
enhancement...


Subject: [patch] terminate the oops printing with a defined string/uuid
From: Arjan van de Ven <arjan@xxxxxxxxxxxxxxx>

Right now, it's hard for automated tools to determine when an oops has
ended; there's no clear marker for this. For later kernels I would also
like a UUID to printed here, but for short term I've put all zeros there
since printing a UUID seems to involve cleaning up/rewriting quite a chunk
of random.c and that's more involved -> later patch.

Signed-off-by: Arjan van de Ven <arjan@xxxxxxxxxxxxxxx>

---
kernel/panic.c | 1 +
1 files changed, 1 insertion(+), 0 deletions(-)

Index: linux-2.6.24-rc5/kernel/panic.c
===================================================================
--- linux-2.6.24-rc5.orig/kernel/panic.c
+++ linux-2.6.24-rc5/kernel/panic.c
@@ -272,6 +273,7 @@ void oops_enter(void)
void oops_exit(void)
{
do_oops_enter_exit();
+ printk("---[ end of trace 00000000-0000-0000-0000-000000000000 ]---\n");
}

#ifdef CONFIG_CC_STACKPROTECTOR

Subject: [patch] terminate the oops printing with a defined string/uuid
From: Arjan van de Ven <arjan@xxxxxxxxxxxxxxx>

Right now, it's hard for automated tools to determine when an oops has
ended; there's no clear marker for this. For later kernels I would also
like a UUID to printed here, but for short term I've put all zeros there
since printing a UUID seems to involve cleaning up/rewriting quite a chunk
of random.c and that's more involved -> later patch.

Signed-off-by: Arjan van de Ven <arjan@xxxxxxxxxxxxxxx>

---
kernel/panic.c | 1 +
1 files changed, 1 insertion(+), 0 deletions(-)

Index: linux-2.6.24-rc5/kernel/panic.c
===================================================================
--- linux-2.6.24-rc5.orig/kernel/panic.c
+++ linux-2.6.24-rc5/kernel/panic.c
@@ -272,6 +273,7 @@ void oops_enter(void)
void oops_exit(void)
{
do_oops_enter_exit();
+ printk("---[ end of trace 0000-00-00-00-000000 ]---\n");
}

#ifdef CONFIG_CC_STACKPROTECTOR