diff options
author | Randy Dunlap <rdunlap@xenotime.net> | 2006-04-11 01:53:11 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-04-11 09:18:33 -0400 |
commit | 7bee5c0fd2b25d185650cbfa049823e03f648c09 (patch) | |
tree | f0937f3d2ce67cee54ad8a81d7a6628e21d8e955 | |
parent | 6cf272acd59e4e7a17b969adcdf413e15754bfe4 (diff) |
[PATCH] i386: print EIP/ESP last
Print summary registers (EIP and SS:ESP only) as last death info. This
makes this important data visible in case it had scrolled off the top of
the display. Similar to what x86_64 does. Suggested by Andi Kleen.
Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | arch/i386/kernel/traps.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/arch/i386/kernel/traps.c b/arch/i386/kernel/traps.c index e38527994590..2d22f5761b1d 100644 --- a/arch/i386/kernel/traps.c +++ b/arch/i386/kernel/traps.c | |||
@@ -365,6 +365,9 @@ void die(const char * str, struct pt_regs * regs, long err) | |||
365 | 365 | ||
366 | if (++die.lock_owner_depth < 3) { | 366 | if (++die.lock_owner_depth < 3) { |
367 | int nl = 0; | 367 | int nl = 0; |
368 | unsigned long esp; | ||
369 | unsigned short ss; | ||
370 | |||
368 | handle_BUG(regs); | 371 | handle_BUG(regs); |
369 | printk(KERN_EMERG "%s: %04lx [#%d]\n", str, err & 0xffff, ++die_counter); | 372 | printk(KERN_EMERG "%s: %04lx [#%d]\n", str, err & 0xffff, ++die_counter); |
370 | #ifdef CONFIG_PREEMPT | 373 | #ifdef CONFIG_PREEMPT |
@@ -387,8 +390,19 @@ void die(const char * str, struct pt_regs * regs, long err) | |||
387 | printk("\n"); | 390 | printk("\n"); |
388 | if (notify_die(DIE_OOPS, str, regs, err, | 391 | if (notify_die(DIE_OOPS, str, regs, err, |
389 | current->thread.trap_no, SIGSEGV) != | 392 | current->thread.trap_no, SIGSEGV) != |
390 | NOTIFY_STOP) | 393 | NOTIFY_STOP) { |
391 | show_registers(regs); | 394 | show_registers(regs); |
395 | /* Executive summary in case the oops scrolled away */ | ||
396 | esp = (unsigned long) (®s->esp); | ||
397 | savesegment(ss, ss); | ||
398 | if (user_mode(regs)) { | ||
399 | esp = regs->esp; | ||
400 | ss = regs->xss & 0xffff; | ||
401 | } | ||
402 | printk(KERN_EMERG "EIP: [<%08lx>] ", regs->eip); | ||
403 | print_symbol("%s", regs->eip); | ||
404 | printk(" SS:ESP %04x:%08lx\n", ss, esp); | ||
405 | } | ||
392 | else | 406 | else |
393 | regs = NULL; | 407 | regs = NULL; |
394 | } else | 408 | } else |