summaryrefslogtreecommitdiffstats
path: root/testsuite/systemtap.base/overload.exp
blob: 26988efc80b29f005dda6ec5a9d0e361065900ee (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
30
31
32
33
34
35
36
37
if {![installtest_p]} {untested "OVERLOAD"; return}

set script {
    global k

    probe begin {
	print("systemtap starting probe\n")
	k["foo"] = 0
    }

    probe kernel.function("vfs_read"), kernel.function("vfs_write") {
	k["foo"]++
    }
    probe end {
	print("systemtap ending probe\n")
    }
}

# OVERLOAD1 tests to make sure normal operation doesn't receive an
# overload indication
set test "OVERLOAD1"
set error "probe overhead exceeded threshold"
stap_run_error $test 0 $error "" -u -e $script

# OVERLOAD2 is the same script, but we're adjusting the
# STP_OVERLOAD_INTERVAL and STP_OVERLOAD_THRESHOLD to low values so
# that we *will* get an overload.
set test "OVERLOAD2"
stap_run_error $test 1 $error "" -u -DSTP_OVERLOAD_INTERVAL=1000LL -DSTP_OVERLOAD_THRESHOLD=100LL -e $script

# OVERLOAD3 is the same script with the same low STP_OVERLOAD_INTERVAL
# and STP_OVERLOAD_THRESHOLD values, but we're also specifying
# STP_NO_OVERLOAD, which should turn overload processing off.   So,
# even though we have low overhead tuning values, we *shouldn't*
# overload.
set test "OVERLOAD3"
stap_run_error $test 0 $error "" -u -DSTP_NO_OVERLOAD -DSTP_OVERLOAD_INTERVAL=1000LL -DSTP_OVERLOAD_THRESHOLD=100LL -e $script