summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Wielaard <mjw@redhat.com>2009-04-21 12:06:53 +0200
committerMark Wielaard <mjw@redhat.com>2009-04-21 12:06:53 +0200
commit15d8b8ee8214d1fbba80329c5a571974a4403476 (patch)
treec595b31b440b1da851f1d24d7647e0383e61bb25
parent7822c594fa32615588fb4ed48eb2728f6dae9e10 (diff)
downloadsystemtap-steved-15d8b8ee8214d1fbba80329c5a571974a4403476.tar.gz
systemtap-steved-15d8b8ee8214d1fbba80329c5a571974a4403476.tar.xz
systemtap-steved-15d8b8ee8214d1fbba80329c5a571974a4403476.zip
Don't use stack fallback for user space unwinding when using dwarf unwinder.
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.
-rw-r--r--runtime/stack-i386.c12
-rw-r--r--runtime/stack-x86_64.c12
2 files changed, 16 insertions, 8 deletions
diff --git a/runtime/stack-i386.c b/runtime/stack-i386.c
index 6fd1613f..69623765 100644
--- a/runtime/stack-i386.c
+++ b/runtime/stack-i386.c
@@ -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);
diff --git a/runtime/stack-x86_64.c b/runtime/stack-x86_64.c
index 03eb33e8..9afdf38a 100644
--- a/runtime/stack-x86_64.c
+++ b/runtime/stack-x86_64.c
@@ -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);