| 1 |
# timeofday.exp |
| 2 |
# |
| 3 |
# This test is meant to make sure that our time functions can still be called |
| 4 |
# from contexts where do_gettimeofday is unsafe (e.g. when xtime_lock is held). |
| 5 |
# See bug #2525 for more details. |
| 6 |
|
| 7 |
proc sleep_one_sec {} { |
| 8 |
wait_n_secs 1; |
| 9 |
return 0; |
| 10 |
} |
| 11 |
|
| 12 |
set systemtap_script { |
| 13 |
global timeofday |
| 14 |
probe kernel.function("do_timer") { |
| 15 |
timeofday = gettimeofday_us() |
| 16 |
} |
| 17 |
probe begin { |
| 18 |
log("systemtap starting probe") |
| 19 |
} |
| 20 |
probe end { |
| 21 |
log("systemtap ending probe") |
| 22 |
printf("%d\n", timeofday) |
| 23 |
} |
| 24 |
} |
| 25 |
|
| 26 |
set output_string "\\d+\\r\\n" |
| 27 |
|
| 28 |
stap_run "timeofday test" sleep_one_sec $output_string -e $systemtap_script |