diff options
author | Tim Moore <timoore@redhat.com> | 2010-01-05 15:18:57 +0100 |
---|---|---|
committer | Tim Moore <timoore@redhat.com> | 2010-01-05 15:18:57 +0100 |
commit | 21e8e579ef10942bf2db3e1514026a6d132b1502 (patch) | |
tree | 08214b1f9a8699ae9368ffb787f2513fcf54d4d7 /testsuite/systemtap.context | |
parent | c799f7e71c710566175d57c25ad775ec29e18ad4 (diff) | |
download | systemtap-steved-21e8e579ef10942bf2db3e1514026a6d132b1502.tar.gz systemtap-steved-21e8e579ef10942bf2db3e1514026a6d132b1502.tar.xz systemtap-steved-21e8e579ef10942bf2db3e1514026a6d132b1502.zip |
bz6436 backtraces from uprobes
This implements proper unwinding from uprobes in the presence of
uretprobe trampolines.
* runtime/stack.c (_stp_stack_print): Rework for uprobe context case
and refactor a bit.
* runtime/uprobes2/uprobes.h (GET_PC_URETPROBE_NONE): new constant
* runtime/uprobes2/uprobes.c (uprobe_get_pc): Support translating the
trampoline function from uprobe context in addition to uretprobe
context.
* runtime/uprobes/uprobes.h (GET_PC_URETPROBE_NONE): ditto
* runtime/uprobes/uprobes.c (uprobe_get_pc): ditto
* tapsets.cxx (uprobe_derived_probe_group::emit_module_decls):
Initialize ri in context to GET_PC_URETPROBE_NONE in generated
enter_uprobe_probe.
* testsuite/systemtap.context/fib.stp: Add an option to do a backtrace
on function entry.
* testsuite/systemtap.context/fib.exp: Test backtrace in function
entry (uprobe) probes.
Diffstat (limited to 'testsuite/systemtap.context')
-rw-r--r-- | testsuite/systemtap.context/fib.exp | 14 | ||||
-rw-r--r-- | testsuite/systemtap.context/fib.stp | 3 |
2 files changed, 17 insertions, 0 deletions
diff --git a/testsuite/systemtap.context/fib.exp b/testsuite/systemtap.context/fib.exp index cc4d75a1..5026e5d0 100644 --- a/testsuite/systemtap.context/fib.exp +++ b/testsuite/systemtap.context/fib.exp @@ -35,3 +35,17 @@ expect { } wait if {$fibcalls == 18 && $maincalls == 2} { pass "$test ($fibcalls $maincalls)" } { fail "$test ($fibcalls $maincalls)" } + +spawn stap -c "$testexe 10" -- $teststp --entry +set fibcalls 0 +set maincalls 0 +expect { + -timeout 120 + -re {^fib[^\r\n]*[\r\n]} { incr fibcalls; exp_continue } + -re {^main[^\r\n]*[\r\n]} { incr maincalls; exp_continue } + -re {^[^\r\n]*[\r\n]} {exp_continue} + timeout { fail "$test (timeout)" } + eof { } +} +wait +if {$fibcalls == 55 && $maincalls == 10} { pass "$test ($fibcalls $maincalls)" } { fail "$test ($fibcalls $maincalls)" } diff --git a/testsuite/systemtap.context/fib.stp b/testsuite/systemtap.context/fib.stp index 85c2fc1d..fe2415f5 100644 --- a/testsuite/systemtap.context/fib.stp +++ b/testsuite/systemtap.context/fib.stp @@ -5,13 +5,16 @@ probe process("fib").function("fib").call { depth++ if (depth > max_depth) { max_depth = depth + %( $# > 0 %? print_ubacktrace_brief(); printf("\n") %) } } probe process("fib").function("fib").return { + %( $# == 0 %? if (depth == max_depth) { print_ubacktrace_brief() printf("\n") } + %) depth-- } |