[PATCH] i386: Do backtrace fallback too
authorAndi Kleen <ak@suse.de>
Fri, 28 Jul 2006 12:44:57 +0000 (14:44 +0200)
committerLinus Torvalds <torvalds@g5.osdl.org>
Sat, 29 Jul 2006 02:28:00 +0000 (19:28 -0700)
Similar patch to earlier x86-64 patch. When the dwarf2 unwinder fails
dump the left over stack with the old unwinder.

Also some clarifications in the headers.

Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
arch/i386/kernel/traps.c

index 313ac1f7dc5aaf88795748554118a8d9e393f83f..3facc8fcb91eb5ad77b32a6acd54fe1c425efe33 100644 (file)
@@ -187,10 +187,21 @@ static void show_trace_log_lvl(struct task_struct *task, struct pt_regs *regs,
                        if (unwind_init_blocked(&info, task) == 0)
                                unw_ret = show_trace_unwind(&info, log_lvl);
                }
-               if (unw_ret > 0) {
-                       if (call_trace > 0)
+               if (unw_ret > 0 && !arch_unw_user_mode(&info)) {
+#ifdef CONFIG_STACK_UNWIND
+                       print_symbol("DWARF2 unwinder stuck at %s\n",
+                                    UNW_PC(info.regs));
+                       if (call_trace == 1) {
+                               printk("Leftover inexact backtrace:\n");
+                               if (UNW_SP(info.regs))
+                                       stack = (void *)UNW_SP(info.regs);
+                       } else if (call_trace > 1)
                                return;
-                       printk("%sLegacy call trace:\n", log_lvl);
+                       else
+                               printk("Full inexact backtrace again:\n");
+#else
+                       printk("Inexact backtrace:\n");
+#endif
                }
        }