diff options
author | Josh Stone <jistone@redhat.com> | 2009-02-23 15:08:02 -0800 |
---|---|---|
committer | Josh Stone <jistone@redhat.com> | 2009-02-23 15:08:02 -0800 |
commit | bf2a0399419306bf26cd57236822c51be893dfb0 (patch) | |
tree | 64ec3f4ccf6241007f2f0a1ac99f8ab7c7fbb84d /testsuite/systemtap.base | |
parent | 5780cc7f8208ebca519d6e076fe403b1220ab865 (diff) | |
download | systemtap-steved-bf2a0399419306bf26cd57236822c51be893dfb0.tar.gz systemtap-steved-bf2a0399419306bf26cd57236822c51be893dfb0.tar.xz systemtap-steved-bf2a0399419306bf26cd57236822c51be893dfb0.zip |
Add a testcase for gtod init/kill
This test simply checks that _gettimeofday_init and _gettimeofday_kill
are pulled in when gettimeofday is used, and also that they are NOT
pulled in when gettimeofday is not used.
Diffstat (limited to 'testsuite/systemtap.base')
-rw-r--r-- | testsuite/systemtap.base/gtod_init.exp | 29 |
1 files changed, 29 insertions, 0 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 |