| 1 |
proc probe_ok {probepoint} { |
| 2 |
set cmd {exec stap -u -p2 -e} |
| 3 |
lappend cmd "probe $probepoint {}" |
| 4 |
return [expr ![catch $cmd]] |
| 5 |
} |
| 6 |
|
| 7 |
set systemtap_script { |
| 8 |
global stat |
| 9 |
probe %s { |
| 10 |
stat[probefunc()] <<< 1 |
| 11 |
} |
| 12 |
probe begin { log ("systemtap starting probe") } |
| 13 |
probe end { |
| 14 |
log ("systemtap ending probe") |
| 15 |
foreach (func in stat limit 5) # don't overflow expect buffer |
| 16 |
printf("%%d %%s\n", @count(stat[func]), func) |
| 17 |
} |
| 18 |
} |
| 19 |
|
| 20 |
set letters [split {abcdefghijklmnopqrstuvwxyz_ABCDEFGHIJKLMNOPQRSTUVWXYZ} {}] |
| 21 |
|
| 22 |
set output_string "(\\d+ \\w+\\r\\n)*(WARNING.*skipped.*)?" |
| 23 |
|
| 24 |
# Because this test is known to expose system crashes, it is not enabled |
| 25 |
# by default. Change the line below to 'if 1' to enable it. |
| 26 |
if 0 { |
| 27 |
foreach start $letters { |
| 28 |
set probepoint "kernel.function(\"$start*\")" |
| 29 |
set prefix "all_kernel_functions:" |
| 30 |
if [probe_ok $probepoint] { |
| 31 |
set script [format $systemtap_script $probepoint] |
| 32 |
stap_run $prefix$probepoint gen_load $output_string -e $script |
| 33 |
} else { |
| 34 |
unsupported "$prefix no match for $probepoint" |
| 35 |
} |
| 36 |
} |
| 37 |
} else { |
| 38 |
untested "all_kernel_functions is disabled" |
| 39 |
} |