]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/i386/kernel/traps.c
Merge branch 'intelfb-patches' of git://git.kernel.org/pub/scm/linux/kernel/git/airli...
[linux-2.6-omap-h63xx.git] / arch / i386 / kernel / traps.c
index e38527994590f8ba12d19ea125e4c18aeb2fc96a..dcc14477af1f0a5d16e083252389ba1d74173eac 100644 (file)
@@ -130,9 +130,8 @@ static inline int print_addr_and_symbol(unsigned long addr, char *log_lvl,
        print_symbol("%s", addr);
 
        printed = (printed + 1) % CONFIG_STACK_BACKTRACE_COLS;
-
        if (printed)
-               printk("  ");
+               printk(" ");
        else
                printk("\n");
 
@@ -150,6 +149,12 @@ static inline unsigned long print_context_stack(struct thread_info *tinfo,
        while (valid_stack_ptr(tinfo, (void *)ebp)) {
                addr = *(unsigned long *)(ebp + 4);
                printed = print_addr_and_symbol(addr, log_lvl, printed);
+               /*
+                * break out of recursive entries (such as
+                * end_of_stack_stop_unwind_function):
+                */
+               if (ebp == *(unsigned long *)ebp)
+                       break;
                ebp = *(unsigned long *)ebp;
        }
 #else
@@ -212,7 +217,6 @@ static void show_stack_log_lvl(struct task_struct *task, unsigned long *esp,
        }
 
        stack = esp;
-       printk(log_lvl);
        for(i = 0; i < kstack_depth_to_print; i++) {
                if (kstack_end(stack))
                        break;
@@ -270,8 +274,9 @@ void show_registers(struct pt_regs *regs)
                regs->esi, regs->edi, regs->ebp, esp);
        printk(KERN_EMERG "ds: %04x   es: %04x   ss: %04x\n",
                regs->xds & 0xffff, regs->xes & 0xffff, ss);
-       printk(KERN_EMERG "Process %s (pid: %d, threadinfo=%p task=%p)",
-               current->comm, current->pid, current_thread_info(), current);
+       printk(KERN_EMERG "Process %.*s (pid: %d, ti=%p task=%p task.ti=%p)",
+               TASK_COMM_LEN, current->comm, current->pid,
+               current_thread_info(), current, current->thread_info);
        /*
         * When in-kernel, we also print out the stack and code at the
         * time of the fault..
@@ -365,6 +370,9 @@ void die(const char * str, struct pt_regs * regs, long err)
 
        if (++die.lock_owner_depth < 3) {
                int nl = 0;
+               unsigned long esp;
+               unsigned short ss;
+
                handle_BUG(regs);
                printk(KERN_EMERG "%s: %04lx [#%d]\n", str, err & 0xffff, ++die_counter);
 #ifdef CONFIG_PREEMPT
@@ -387,8 +395,19 @@ void die(const char * str, struct pt_regs * regs, long err)
                        printk("\n");
                if (notify_die(DIE_OOPS, str, regs, err,
                                        current->thread.trap_no, SIGSEGV) !=
-                               NOTIFY_STOP)
+                               NOTIFY_STOP) {
                        show_registers(regs);
+                       /* Executive summary in case the oops scrolled away */
+                       esp = (unsigned long) (&regs->esp);
+                       savesegment(ss, ss);
+                       if (user_mode(regs)) {
+                               esp = regs->esp;
+                               ss = regs->xss & 0xffff;
+                       }
+                       printk(KERN_EMERG "EIP: [<%08lx>] ", regs->eip);
+                       print_symbol("%s", regs->eip);
+                       printk(" SS:ESP %04x:%08lx\n", ss, esp);
+               }
                else
                        regs = NULL;
        } else