LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* Split multi-line printk in oops output.
@ 2006-09-11  3:07 Dave Jones
  2006-09-11  5:44 ` Andi Kleen
  0 siblings, 1 reply; 4+ messages in thread
From: Dave Jones @ 2006-09-11  3:07 UTC (permalink / raw)
  To: Linux Kernel; +Cc: ak

Sometimes, bug reports come in where we've had an oops, and the
only record we have is what the reporter saw on screen shortly
before the system locked up completely.  Unfortunatly, syslog
only prints lines beginning with KERN_EMERG to the console, so
some lines get lost.
An example of this can be seen at https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=203723

Some of this information isn't vital to diagnosis, but some parts
are useful, such as the tainted flag.

Signed-off-by: Dave Jones <davej@redhat.com>

--- local-git/arch/i386/kernel/traps.c~	2006-09-10 23:01:18.000000000 -0400
+++ local-git/arch/i386/kernel/traps.c	2006-09-10 23:03:33.000000000 -0400
@@ -291,10 +291,11 @@ void show_registers(struct pt_regs *regs
 		ss = regs->xss & 0xffff;
 	}
 	print_modules();
-	printk(KERN_EMERG "CPU:    %d\nEIP:    %04x:[<%08lx>]    %s VLI\n"
-			"EFLAGS: %08lx   (%s %.*s) \n",
-		smp_processor_id(), 0xffff & regs->xcs, regs->eip,
-		print_tainted(), regs->eflags, system_utsname.release,
+	printk(KERN_EMERG "CPU:    %d\n", smp_processor_id());
+	printk(KERN_EMERG "EIP:    %04x:[<%08lx>]    %s VLI\n",
+		0xffff & regs->xcs, regs->eip, print_tainted());
+	printk(KERN_EMERG "EFLAGS: %08lx   (%s %.*s)\n",
+		regs->eflags, system_utsname.release,
 		(int)strcspn(system_utsname.version, " "),
 		system_utsname.version);
 	print_symbol(KERN_EMERG "EIP is at %s\n", regs->eip);

-- 
http://www.codemonkey.org.uk

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Split multi-line printk in oops output.
  2006-09-11  3:07 Split multi-line printk in oops output Dave Jones
@ 2006-09-11  5:44 ` Andi Kleen
  2006-09-11  6:07   ` Dave Jones
  0 siblings, 1 reply; 4+ messages in thread
From: Andi Kleen @ 2006-09-11  5:44 UTC (permalink / raw)
  To: Dave Jones; +Cc: Linux Kernel


>  	print_modules();
> -	printk(KERN_EMERG "CPU:    %d\nEIP:    %04x:[<%08lx>]    %s VLI\n"
> -			"EFLAGS: %08lx   (%s %.*s) \n",
> -		smp_processor_id(), 0xffff & regs->xcs, regs->eip,
> -		print_tainted(), regs->eflags, system_utsname.release,
> +	printk(KERN_EMERG "CPU:    %d\n", smp_processor_id());
> +	printk(KERN_EMERG "EIP:    %04x:[<%08lx>]    %s VLI\n",
> +		0xffff & regs->xcs, regs->eip, print_tainted());
> +	printk(KERN_EMERG "EFLAGS: %08lx   (%s %.*s)\n",

Still only using a single printk would be slightly safer

-Andi

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Split multi-line printk in oops output.
  2006-09-11  5:44 ` Andi Kleen
@ 2006-09-11  6:07   ` Dave Jones
  2006-09-11 20:24     ` Andi Kleen
  0 siblings, 1 reply; 4+ messages in thread
From: Dave Jones @ 2006-09-11  6:07 UTC (permalink / raw)
  To: Andi Kleen; +Cc: Linux Kernel

On Mon, Sep 11, 2006 at 07:44:15AM +0200, Andi Kleen wrote:
 > 
 > >  	print_modules();
 > > -	printk(KERN_EMERG "CPU:    %d\nEIP:    %04x:[<%08lx>]    %s VLI\n"
 > > -			"EFLAGS: %08lx   (%s %.*s) \n",
 > > -		smp_processor_id(), 0xffff & regs->xcs, regs->eip,
 > > -		print_tainted(), regs->eflags, system_utsname.release,
 > > +	printk(KERN_EMERG "CPU:    %d\n", smp_processor_id());
 > > +	printk(KERN_EMERG "EIP:    %04x:[<%08lx>]    %s VLI\n",
 > > +		0xffff & regs->xcs, regs->eip, print_tainted());
 > > +	printk(KERN_EMERG "EFLAGS: %08lx   (%s %.*s)\n",
 > 
 > Still only using a single printk would be slightly safer

Signed-off-by: Dave Jones <davej@redhat.com>

diff --git a/arch/i386/kernel/traps.c b/arch/i386/kernel/traps.c
index 7e9edaf..b30fc9e 100644
--- a/arch/i386/kernel/traps.c
+++ b/arch/i386/kernel/traps.c
@@ -291,8 +291,9 @@ void show_registers(struct pt_regs *regs
 		ss = regs->xss & 0xffff;
 	}
 	print_modules();
-	printk(KERN_EMERG "CPU:    %d\nEIP:    %04x:[<%08lx>]    %s VLI\n"
-			"EFLAGS: %08lx   (%s %.*s) \n",
+	printk(KERN_EMERG "CPU:    %d\n"
+		KERN_EMERG "EIP:    %04x:[<%08lx>]    %s VLI\n"
+		KERN_EMERG "EFLAGS: %08lx   (%s %.*s)\n",
 		smp_processor_id(), 0xffff & regs->xcs, regs->eip,
 		print_tainted(), regs->eflags, system_utsname.release,
 		(int)strcspn(system_utsname.version, " "),


-- 
http://www.codemonkey.org.uk

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Split multi-line printk in oops output.
  2006-09-11  6:07   ` Dave Jones
@ 2006-09-11 20:24     ` Andi Kleen
  0 siblings, 0 replies; 4+ messages in thread
From: Andi Kleen @ 2006-09-11 20:24 UTC (permalink / raw)
  To: Dave Jones; +Cc: Linux Kernel

On Monday 11 September 2006 08:07, Dave Jones wrote:
> On Mon, Sep 11, 2006 at 07:44:15AM +0200, Andi Kleen wrote:
>  > >  	print_modules();
>  > > -	printk(KERN_EMERG "CPU:    %d\nEIP:    %04x:[<%08lx>]    %s VLI\n"
>  > > -			"EFLAGS: %08lx   (%s %.*s) \n",
>  > > -		smp_processor_id(), 0xffff & regs->xcs, regs->eip,
>  > > -		print_tainted(), regs->eflags, system_utsname.release,
>  > > +	printk(KERN_EMERG "CPU:    %d\n", smp_processor_id());
>  > > +	printk(KERN_EMERG "EIP:    %04x:[<%08lx>]    %s VLI\n",
>  > > +		0xffff & regs->xcs, regs->eip, print_tainted());
>  > > +	printk(KERN_EMERG "EFLAGS: %08lx   (%s %.*s)\n",
>  >
>  > Still only using a single printk would be slightly safer
>
> Signed-off-by: Dave Jones <davej@redhat.com>

Added thanks., Please include the full description on reposted patches
in the future too.

-Andi


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-09-11 21:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-09-11  3:07 Split multi-line printk in oops output Dave Jones
2006-09-11  5:44 ` Andi Kleen
2006-09-11  6:07   ` Dave Jones
2006-09-11 20:24     ` Andi Kleen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).