ia64/xen-unstable

changeset 6247:ced400d25886

Clean up formatting of Xen crash messages.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Thu Aug 18 14:26:36 2005 +0000 (2005-08-18)
parents 54f652eee324
children ff31cdc8741f
files xen/arch/x86/traps.c xen/arch/x86/x86_32/traps.c xen/arch/x86/x86_64/traps.c xen/drivers/char/console.c
line diff
     1.1 --- a/xen/arch/x86/traps.c	Thu Aug 18 14:18:15 2005 +0000
     1.2 +++ b/xen/arch/x86/traps.c	Thu Aug 18 14:26:36 2005 +0000
     1.3 @@ -159,10 +159,8 @@ void show_trace(unsigned long *esp)
     1.4          addr = *stack++;
     1.5          if ( is_kernel_text(addr) )
     1.6          {
     1.7 -            if ( (i != 0) && ((i % 6) == 0) )
     1.8 -                printk("\n   ");
     1.9              printk("[<%p>]", _p(addr));
    1.10 -            print_symbol(" %s\n", addr);
    1.11 +            print_symbol(" %s\n   ", addr);
    1.12              i++;
    1.13          }
    1.14      }
     2.1 --- a/xen/arch/x86/x86_32/traps.c	Thu Aug 18 14:18:15 2005 +0000
     2.2 +++ b/xen/arch/x86/x86_32/traps.c	Thu Aug 18 14:26:36 2005 +0000
     2.3 @@ -66,7 +66,8 @@ void show_registers(struct cpu_user_regs
     2.4  
     2.5      printk("CPU:    %d\nEIP:    %04lx:[<%08lx>]",
     2.6             smp_processor_id(), (unsigned long)0xffff & regs->cs, eip);
     2.7 -    print_symbol(" %s\n", eip);
     2.8 +    if ( !GUEST_MODE(regs) )
     2.9 +        print_symbol(" %s\n", eip);
    2.10      printk("EFLAGS: %08lx   CONTEXT: %s\n", eflags, context);
    2.11      printk("eax: %08x   ebx: %08x   ecx: %08x   edx: %08x\n",
    2.12             regs->eax, regs->ebx, regs->ecx, regs->edx);
     3.1 --- a/xen/arch/x86/x86_64/traps.c	Thu Aug 18 14:18:15 2005 +0000
     3.2 +++ b/xen/arch/x86/x86_64/traps.c	Thu Aug 18 14:26:36 2005 +0000
     3.3 @@ -17,7 +17,8 @@ void show_registers(struct cpu_user_regs
     3.4  {
     3.5      printk("CPU:    %d\nEIP:    %04x:[<%016lx>]",
     3.6             smp_processor_id(), 0xffff & regs->cs, regs->rip);
     3.7 -    print_symbol(" %s\n", regs->rip);
     3.8 +    if ( !GUEST_MODE(regs) )
     3.9 +        print_symbol(" %s\n", regs->rip);
    3.10      printk("EFLAGS: %016lx\n", regs->eflags);
    3.11      printk("rax: %016lx   rbx: %016lx   rcx: %016lx   rdx: %016lx\n",
    3.12             regs->rax, regs->rbx, regs->rcx, regs->rdx);
     4.1 --- a/xen/drivers/char/console.c	Thu Aug 18 14:18:15 2005 +0000
     4.2 +++ b/xen/drivers/char/console.c	Thu Aug 18 14:26:36 2005 +0000
     4.3 @@ -652,8 +652,9 @@ static int __init debugtrace_init(void)
     4.4  void panic(const char *fmt, ...)
     4.5  {
     4.6      va_list args;
     4.7 -    char buf[128], cpustr[10];
     4.8 +    char buf[128];
     4.9      unsigned long flags;
    4.10 +    static spinlock_t lock = SPIN_LOCK_UNLOCKED;
    4.11      extern void machine_restart(char *);
    4.12      
    4.13      debugtrace_dump();
    4.14 @@ -665,16 +666,13 @@ void panic(const char *fmt, ...)
    4.15      debugger_trap_immediate();
    4.16  
    4.17      /* Spit out multiline message in one go. */
    4.18 -    spin_lock_irqsave(&console_lock, flags);
    4.19 -    __putstr("\n****************************************\n");
    4.20 -    __putstr("Panic on CPU");
    4.21 -    sprintf(cpustr, "%d", smp_processor_id());
    4.22 -    __putstr(cpustr);
    4.23 -    __putstr(":\n");
    4.24 -    __putstr(buf);
    4.25 -    __putstr("****************************************\n\n");
    4.26 -    __putstr("Reboot in five seconds...\n");
    4.27 -    spin_unlock_irqrestore(&console_lock, flags);
    4.28 +    spin_lock_irqsave(&lock, flags);
    4.29 +    printk("\n****************************************\n");
    4.30 +    printk("Panic on CPU %d:\n", smp_processor_id());
    4.31 +    printk(buf);
    4.32 +    printk("****************************************\n\n");
    4.33 +    printk("Reboot in five seconds...\n");
    4.34 +    spin_unlock_irqrestore(&lock, flags);
    4.35  
    4.36      watchdog_disable();
    4.37      mdelay(5000);