diff options
author | fche <fche> | 2008-01-15 03:34:56 +0000 |
---|---|---|
committer | fche <fche> | 2008-01-15 03:34:56 +0000 |
commit | d94d159d9524a9b705c2704ca15b5014a24c923e (patch) | |
tree | bdf8d0a0c8c079df44221373e2b87d4ce4bdb439 | |
parent | d97870325d227b4c51e616a3d2ff8a521d89829f (diff) | |
download | systemtap-steved-d94d159d9524a9b705c2704ca15b5014a24c923e.tar.gz systemtap-steved-d94d159d9524a9b705c2704ca15b5014a24c923e.tar.xz systemtap-steved-d94d159d9524a9b705c2704ca15b5014a24c923e.zip |
PR 4935. * systemtap.base/onoffprobe.*: Toughen test.
-rw-r--r-- | testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | testsuite/systemtap.base/onoffprobe.exp | 67 | ||||
-rw-r--r-- | testsuite/systemtap.base/onoffprobe.stp | 23 |
3 files changed, 47 insertions, 48 deletions
diff --git a/testsuite/ChangeLog b/testsuite/ChangeLog index d8439450..87d31c96 100644 --- a/testsuite/ChangeLog +++ b/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2008-01-14 Frank Ch. Eigler <fche@elastic.org> + + PR 4935. + * systemtap.base/onoffprobe.*: Toughen test. + 2008-01-12 Frank Ch. Eigler <fche@elastic.org> * lib/systemtap.exp (get_system_info): Look for $builddir/SNAPSHOT too. diff --git a/testsuite/systemtap.base/onoffprobe.exp b/testsuite/systemtap.base/onoffprobe.exp index 41e107d7..b86de4ea 100644 --- a/testsuite/systemtap.base/onoffprobe.exp +++ b/testsuite/systemtap.base/onoffprobe.exp @@ -4,54 +4,37 @@ if {![installtest_p]} { untested $test; return } spawn stap $srcdir/$subdir/$test.stp -m $test set pid $spawn_id set ok 0 + +proc advance {} { + global test + global expect_out + global ok + pass "$test $expect_out(1,string)" + incr ok + exec echo $ok > /proc/systemtap/$test/switch + exec echo dummy > /dev/null + exp_continue +} + 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" - } + -re "(begin1 probed)\r\n" { advance } + -re "^(function return probed)\r\n" { advance } + -re "^(function entry probed)\r\n" { advance } + -re "^(timer probed)\r\n" { advance } + -re "^(profile probed)\r\n" { advance } + -re "^(alias\.one\.a and alias\.one and alias\.\* probed)\r\n" { advance } + -re "^(alias\.one\.b and alias\.one and alias\.\* probed)\r\n" { advance } + -re "^(alias\.two and alias\.\* probed)\r\n" { + pass "$test $expect_out(1,string)" + incr ok } - timeout { fail "$test (timeout)" } - eof { } + 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)"} +if {$ok != 8} {fail "conditional probes ($ok)"} diff --git a/testsuite/systemtap.base/onoffprobe.stp b/testsuite/systemtap.base/onoffprobe.stp index 11968540..f7169039 100644 --- a/testsuite/systemtap.base/onoffprobe.stp +++ b/testsuite/systemtap.base/onoffprobe.stp @@ -1,34 +1,45 @@ -global switch=0 +global switch=-1 #begin probe +probe begin if (switch==-1) { + log("begin1 probed"); +} + probe begin if (switch==0) { - log("begin probed\n"); + log("begin2 probed"); } #dwarf probe (return) probe kernel.function("sys_write").return if (switch == 1) { - log("function return probed\n") + log("function return probed") switch = 0 } #dwarf probe (entry) probe kernel.function("sys_write") if (switch == 2) { - log("function entry probed\n") + log("function entry probed") switch = 0 } #timer probe probe timer.s(1) if (switch == 3) { - log("timer probed\n") + log("timer probed") switch = 0 } #profile probe probe timer.profile if (switch == 4) { - log("profile probed\n") + log("profile probed") switch = 0 } +# aliasess +probe alias.one.a = timer.s(2) if (switch == 5) { print("alias.one.a and") } +probe alias.one.b = timer.s(3) if (switch == 6) { print("alias.one.b and") } +probe alias.one = alias.one.* if (switch >= 5 && switch < 7) { print(" alias.one and") } +probe alias.two = timer.s(4) if (switch == 7) { print("alias.two and") } +probe alias.* if (switch) { log(" alias.* probed") } + probe procfs("switch").write { switch = strtol($value, 10) } |