blob: 48616b1fdb86b9bbf5c14c20ae7838cb67fe708b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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
|