| 1 |
if {![installtest_p]} {untested "OVERLOAD"; return} |
| 2 |
|
| 3 |
set script { |
| 4 |
global k |
| 5 |
|
| 6 |
probe begin { |
| 7 |
print("systemtap starting probe\n") |
| 8 |
k["foo"] = 0 |
| 9 |
} |
| 10 |
|
| 11 |
probe kernel.function("vfs_read"), kernel.function("vfs_write") { |
| 12 |
k["foo"]++ |
| 13 |
} |
| 14 |
probe end { |
| 15 |
print("systemtap ending probe\n") |
| 16 |
} |
| 17 |
} |
| 18 |
|
| 19 |
# OVERLOAD1 tests to make sure normal operation doesn't receive an |
| 20 |
# overload indication |
| 21 |
set test "OVERLOAD1" |
| 22 |
set error "probe overhead exceeded threshold" |
| 23 |
stap_run_error $test 0 $error "" -u -e $script |
| 24 |
|
| 25 |
# OVERLOAD2 is the same script, but we're adjusting the |
| 26 |
# STP_OVERLOAD_INTERVAL and STP_OVERLOAD_THRESHOLD to low values so |
| 27 |
# that we *will* get an overload. |
| 28 |
set test "OVERLOAD2" |
| 29 |
stap_run_error $test 1 $error "" -u -DSTP_OVERLOAD_INTERVAL=1000LL -DSTP_OVERLOAD_THRESHOLD=100LL -e $script |
| 30 |
|
| 31 |
# OVERLOAD3 is the same script with the same low STP_OVERLOAD_INTERVAL |
| 32 |
# and STP_OVERLOAD_THRESHOLD values, but we're also specifying |
| 33 |
# STP_NO_OVERLOAD, which should turn overload processing off. So, |
| 34 |
# even though we have low overhead tuning values, we *shouldn't* |
| 35 |
# overload. |
| 36 |
set test "OVERLOAD3" |
| 37 |
stap_run_error $test 0 $error "" -u -DSTP_NO_OVERLOAD -DSTP_OVERLOAD_INTERVAL=1000LL -DSTP_OVERLOAD_THRESHOLD=100LL -e $script |