]> sourceware.org Git - systemtap.git/commitdiff
Don't use stack fallback for user space unwinding when using dwarf unwinder.
authorMark Wielaard <mjw@redhat.com>
Tue, 21 Apr 2009 10:06:53 +0000 (12:06 +0200)
committerMark Wielaard <mjw@redhat.com>
Tue, 21 Apr 2009 10:06:53 +0000 (12:06 +0200)
It never seems to be anywhere near correct.

* runtime/stack-i386.c (__stp_stack_print): Stop unwinding when dwarf
  unwinder fails and we are unwinding user space task.
* runtime/stack-x86_64.c (__stp_stack_print): Likewise.

runtime/stack-i386.c
runtime/stack-x86_64.c

index 6fd1613fdc766b63f3702ae97038e2b47ab021fa..696237651e4dc7fcacd4c881cd150459d152ef26 100644 (file)
@@ -69,11 +69,15 @@ static void __stp_stack_print (struct pt_regs *regs, int verbose, int levels,
                        levels--;
                        continue;
                }
-               /* If an error happened or we hit a kretprobe trampoline, use fallback backtrace */
-               /* FIXME: is there a way to unwind across kretprobe trampolines? */
-               if (ret < 0 || (ret > 0 && UNW_PC(&info) == _stp_kretprobe_trampoline))
+               /* If an error happened or we hit a kretprobe trampoline,
+                * use fallback backtrace, unless user task backtrace.
+                * FIXME: is there a way to unwind across kretprobe
+                * trampolines? */
+               if ((ret < 0
+                    || (ret > 0 && UNW_PC(&info) == _stp_kretprobe_trampoline))
+                   && ! (tsk || arch_unw_user_mode(&info)))
                        _stp_stack_print_fallback(UNW_SP(&info), verbose, levels);
-               break;
+               return;
        }
 #else /* ! STP_USE_DWARF_UNWINDER */
        _stp_stack_print_fallback((unsigned long)&REG_SP(regs), verbose, levels);
index 03eb33e8f072d4114b3a1bf6d707c312df394d89..9afdf38acd30fab0af0452cfc7792421598c30c3 100644 (file)
@@ -43,11 +43,15 @@ static void __stp_stack_print(struct pt_regs *regs, int verbose, int levels,
                        levels--;
                        continue;
                }
-               /* If an error happened or we hit a kretprobe trampoline, use fallback backtrace */
-               /* FIXME: is there a way to unwind across kretprobe trampolines? */
-               if (ret < 0 || (ret > 0 && UNW_PC(&info) == _stp_kretprobe_trampoline))
+               /* If an error happened or we hit a kretprobe trampoline,
+                * use fallback backtrace, unless user task backtrace.
+                * FIXME: is there a way to unwind across kretprobe
+                * trampolines? */
+               if ((ret < 0
+                    || (ret > 0 && UNW_PC(&info) == _stp_kretprobe_trampoline))
+                   && ! (tsk || arch_unw_user_mode(&info)))
                        _stp_stack_print_fallback(UNW_SP(&info), verbose, levels);
-               break;
+               return;
        }
 #else /* ! STP_USE_DWARF_UNWINDER */
        _stp_stack_print_fallback(REG_SP(regs), verbose, levels);
This page took 0.027392 seconds and 5 git commands to generate.