summaryrefslogtreecommitdiffstats
path: root/testsuite/systemtap.base/gtod_init.exp
diff options
context:
space:
mode:
authorMark Wielaard <mjw@redhat.com>2009-03-17 16:58:35 +0100
committerMark Wielaard <mjw@redhat.com>2009-03-17 16:58:35 +0100
commitbf33ee46c8fff4d181b7f28521f12175bd32ec77 (patch)
tree5e0a9e1047af60389eee36da54182b52d3d53ee7 /testsuite/systemtap.base/gtod_init.exp
parent524c6f82b0a3c010d0fd6a67b1afcfbf55b789a6 (diff)
parent30cb532a560ed152b86506b80490e99195970271 (diff)
downloadsystemtap-steved-bf33ee46c8fff4d181b7f28521f12175bd32ec77.tar.gz
systemtap-steved-bf33ee46c8fff4d181b7f28521f12175bd32ec77.tar.xz
systemtap-steved-bf33ee46c8fff4d181b7f28521f12175bd32ec77.zip
Merge branch 'master' into pr6866
Resolved conflicts: runtime/task_finder.c: name vs path.
Diffstat (limited to 'testsuite/systemtap.base/gtod_init.exp')
-rw-r--r--testsuite/systemtap.base/gtod_init.exp29
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