diff options
Diffstat (limited to 'testsuite')
-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-- } |