diff options
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/systemtap.base/gtod_init.exp | 29 | ||||
-rw-r--r-- | testsuite/systemtap.base/static_uprobes.exp | 6 |
2 files changed, 32 insertions, 3 deletions
diff --git a/testsuite/systemtap.base/gtod_init.exp b/testsuite/systemtap.base/gtod_init.exp new file mode 100644 index 00000000..48616b1f --- /dev/null +++ b/testsuite/systemtap.base/gtod_init.exp @@ -0,0 +1,29 @@ +# test for checking initialization of the time subsystem +set test "gtod_init" + +# check that init and kill are both present with a gettimeofday +set time_init 0 +set time_kill 0 +spawn stap -p2 -e {probe begin { println(gettimeofday_s()) }} +expect { + -timeout 120 + -re {\n_gettimeofday_init:} { incr time_init; exp_continue } + -re {\n_gettimeofday_kill:} { incr time_kill; exp_continue } + timeout { fail "$test (timeout)" } + eof { + if {$time_init == 1} { pass "$test (init)" } { fail "$test (init $time_init)" } + if {$time_kill == 1} { pass "$test (kill)" } { fail "$test (kill $time_kill)" } + } +} +wait + +# check that init and kill are both NOT present without a gettimeofday +spawn stap -p2 -e {probe begin { println(get_cycles()) }} +expect { + -timeout 120 + -re {\n_gettimeofday_init:} { fail "$test (bad init)" } + -re {\n_gettimeofday_kill:} { fail "$test (bad kill)" } + timeout { fail "$test (timeout)" } + eof { pass "$test (no init/kill)" } +} +wait diff --git a/testsuite/systemtap.base/static_uprobes.exp b/testsuite/systemtap.base/static_uprobes.exp index c76d4805..a4bd5e2c 100644 --- a/testsuite/systemtap.base/static_uprobes.exp +++ b/testsuite/systemtap.base/static_uprobes.exp @@ -14,6 +14,7 @@ puts $fp " void bar (int i) { + STATIC_UPROBES_TEST_PROBE_2(i); if (i == 0) i = 1000; STAP_PROBE1(static_uprobes,test_probe_2,i); @@ -158,7 +159,7 @@ expect { wait -if {$ok == 4} { pass "$test C" } { fail "$test C ($ok)" } +if {$ok == 5} { pass "$test C" } { fail "$test C ($ok)" } set ok 0 @@ -169,7 +170,6 @@ verbose -log "spawn stap -c $sup_exepath $sup_stppath" spawn stap -c $sup_exepath $sup_stppath expect { -timeout 180 - -re {In test_probe_1 probe} { incr ok; exp_continue } -re {In test_probe_2 probe 0x2} { incr ok; exp_continue } -re {In test_probe_0 probe 0x3} { incr ok; exp_continue } -re {In test_probe_3 probe 0x3 0x[0-9a-f][0-9a-f]} { incr ok; exp_continue } @@ -180,7 +180,7 @@ expect { wait -if {$ok == 4} { pass "$test C++" } { fail "$test C++ ($ok)" } +if {$ok == 5} { pass "$test C++" } { fail "$test C++ ($ok)" } # catch {exec rm -f $sup_srcpath $sup_exepath $supcplus_exepath $sup_hpath $sup_stppath} |