| 1 |
if {![installtest_p]} {untested "MAXMEMORY"; 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 |
# MAXMEMORY1 tests to make sure normal operation doesn't receive a |
| 20 |
# max memory error |
| 21 |
set test "MAXMEMORY1" |
| 22 |
set error {[^\r]+ allocation failed} |
| 23 |
stap_run_error $test 0 $error "" -u -e $script |
| 24 |
|
| 25 |
# MAXMEMORY2 is the same script, but we're adjusting STP_MAXMEMORY to |
| 26 |
# a low value so that we *will* get an allocation error or an insert |
| 27 |
# module error. |
| 28 |
set test "MAXMEMORY2" |
| 29 |
stap_run_error $test 1 $error "" -u -DSTP_MAXMEMORY=200 -e $script |