summaryrefslogtreecommitdiffstats
path: root/testsuite/systemtap.base
diff options
context:
space:
mode:
authorJosh Stone <jistone@redhat.com>2009-05-20 14:46:25 -0700
committerJosh Stone <jistone@redhat.com>2009-05-20 14:53:09 -0700
commit29e2616aeeb82605a6efe1dbc574b499781eafbe (patch)
tree99cf2ca2c3c10b2bd72733a5b10626e58779ad0c /testsuite/systemtap.base
parent7872a5b9d76dc78d8956de3d2a11757783121674 (diff)
downloadsystemtap-steved-29e2616aeeb82605a6efe1dbc574b499781eafbe.tar.gz
systemtap-steved-29e2616aeeb82605a6efe1dbc574b499781eafbe.tar.xz
systemtap-steved-29e2616aeeb82605a6efe1dbc574b499781eafbe.zip
PR10177: init/kill time in sleepy context only
Previously, _stp_init_time and _stp_kill_time were being called from begin/end/error probes, which will run with preemption disabled. The BUG reported on RT kernels showed that cpufreq_unregister_notifier can end up sleeping, which violates our preemption block. This patch moves the init/kill into systemtap_module_init/exit, where it is safe to sleep. The code maintains a new predicate with the define STAP_NEED_GETTIMEOFDAY, so we don't still incur any timer overhead if it's not used.
Diffstat (limited to 'testsuite/systemtap.base')
-rw-r--r--testsuite/systemtap.base/gtod_init.exp29
1 files changed, 0 insertions, 29 deletions
diff --git a/testsuite/systemtap.base/gtod_init.exp b/testsuite/systemtap.base/gtod_init.exp
deleted file mode 100644
index 48616b1f..00000000
--- a/testsuite/systemtap.base/gtod_init.exp
+++ /dev/null
@@ -1,29 +0,0 @@
-# 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