From dfd11cc3ea340096a2829f5ecda29998c73a0acb Mon Sep 17 00:00:00 2001 From: hiramatu Date: Wed, 5 Dec 2007 20:02:01 +0000 Subject: 2007-12-05 Masami Hiramatsu PR 4935 * tapsets.cxx (dwarf_derived_probe::dwarf_derived_probe): Allow user to access kernel variables in the condition of probe points. * stapprobes.5.in : Document the conditional probe point. * NEWS : Ditto. * parseok/five.stp: Add an example of conditional probe point. * parseko/probepoint04.stp: New test for conditional probe point. * parseko/probepoint05.stp: Ditto. * parseko/probepoint06.stp: Ditto. * parseko/probepoint07.stp: Ditto. * parseko/probepoint08.stp: Ditto. * parseko/probepoint09.stp: Ditto. * semok/twentynine.stp: Ditto. * semko/thirtynine.stp: Ditto. * systemtap.base/onoffprobe.*: Ditto. --- testsuite/systemtap.base/onoffprobe.exp | 57 +++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 testsuite/systemtap.base/onoffprobe.exp (limited to 'testsuite/systemtap.base/onoffprobe.exp') diff --git a/testsuite/systemtap.base/onoffprobe.exp b/testsuite/systemtap.base/onoffprobe.exp new file mode 100644 index 00000000..41e107d7 --- /dev/null +++ b/testsuite/systemtap.base/onoffprobe.exp @@ -0,0 +1,57 @@ +set test "onoffprobe" +if {![installtest_p]} { untested $test; return } + +spawn stap $srcdir/$subdir/$test.stp -m $test +set pid $spawn_id +set ok 0 +expect { + -timeout 240 + "begin probed\r\n" { + if {$ok == 0} { + incr ok + pass "conditional begin probe" + exec echo 1 > /proc/systemtap/$test/switch + exec echo "dummy" > /dev/null + exp_continue; + } + } + "function return probed\r\n" { + if {$ok == 1} { + incr ok + pass "conditional dwarf probe (return)" + exec echo 2 > /proc/systemtap/$test/switch + exec echo "dummy" > /dev/null + exp_continue; + } + } + "function entry probed\r\n" { + if {$ok == 2} { + incr ok + pass "conditional dwarf probe (entry)" + exec echo 3 > /proc/systemtap/$test/switch + exp_continue; + } + } + "timer probed\r\n" { + if {$ok == 3} { + incr ok + pass "conditional timer probe" + exec echo 4 > /proc/systemtap/$test/switch + exp_continue; + } + } + "profile probed\r\n" { + if {$ok == 4} { + incr ok + pass "conditional profile probe" + } + } + timeout { fail "$test (timeout)" } + eof { } +} +send "\003" +#FIXME does not handle case of hanging pfaults.stp correctly +wait +exec rm -f $test.ko +if {$ok != 5} {fail "conditional probes ($ok)"} + -- cgit