| 1 |
|
| 2 |
set test "dumpalot" |
| 3 |
|
| 4 |
proc string_occurrences {needleString haystackString} { |
| 5 |
# https://stackoverflow.com/a/34803141/661150 |
| 6 |
regsub -all $needleString $haystackString {} stripped |
| 7 |
expr {([string length $haystackString] - [string length $stripped]) / [string length $needleString]} |
| 8 |
} |
| 9 |
|
| 10 |
|
| 11 |
foreach buflen { 1 2 4 8 16 32 64 } { |
| 12 |
catch {eval exec stap -g --suppress-time-limits --suppress-handler-errors -s $buflen -T 20 $srcdir/$subdir/$test.stp} foo |
| 13 |
verbose -log "$test buflen $buflen output length [string length $foo]" |
| 14 |
foreach msg { ERROR WARNING } { |
| 15 |
verbose -log "$test buflen $buflen $msg [string_occurrences $msg $foo]" |
| 16 |
} |
| 17 |
# don't bother analyze the output, simply observe |
| 18 |
# lower buffer length parameters will incur kernel- and/or userspace-side errors |
| 19 |
# but it should still produce some output, run & shut down cleanly |
| 20 |
pass "$test buf $buflen" |
| 21 |
} |