/usr/share/systemtap/examples/general
NameSizeModeActions
alias_suffixes.meta7240644editdlrm
alias_suffixes.stp10600755editdlrm
also_ran.meta6050644editdlrm
also_ran.stp8040755editdlrm
ansi_colors.meta5070644editdlrm
ansi_colors.stp7160755editdlrm
ansi_colors2.meta5700644editdlrm
ansi_colors2.stp7380755editdlrm
badname.meta4590644editdlrm
badname.stp13350755editdlrm
badname.txt1260644editdlrm
callgraph.meta3880644editdlrm
callgraph.stp2120755editdlrm
callgraph.txt37000644editdlrm
click.wav12900644editdlrm
cpu_throttle.meta7950644editdlrm
cpu_throttle.stp14810755editdlrm
eventcount.meta6370644editdlrm
eventcount.stp69310755editdlrm
eventcount.txt18980644editdlrm
floatingpoint.meta4790644editdlrm
floatingpoint.stp5170644editdlrm
floatingpoint.txt1560644editdlrm
func_time_stats.meta6960644editdlrm
func_time_stats.stp5200755editdlrm
func_time_stats.txt4930644editdlrm
grapher.stp12860755editdlrm
graphs.meta4530644editdlrm
graphs.stp14990755editdlrm
helloworld.meta3970644editdlrm
helloworld.stp570755editdlrm
key.meta3190644editdlrm
key.stp4140755editdlrm
keyhack.meta3550644editdlrm
keyhack.stp2880755editdlrm
measureinterval.meta15820644editdlrm
measureinterval.stp8300755editdlrm
para-callgraph-verbose.meta8790644editdlrm
para-callgraph-verbose.stp4070755editdlrm
para-callgraph.meta7560644editdlrm
para-callgraph.stp4050755editdlrm
para-callgraph.txt44150644editdlrm
py2example.meta5310644editdlrm
py2example.tcl790644editdlrm
py3example.meta5320644editdlrm
py3example.tcl790644editdlrm
pyexample.py8320644editdlrm
pyexample.stp2160644editdlrm
regex.meta5040644editdlrm
regex.stp4910755editdlrm
return.wav65840644editdlrm
sizeof.meta6640644editdlrm
sizeof.stp4820755editdlrm
sizeof.txt1000644editdlrm
sizeof_interactive.meta8160644editdlrm
sizeof_interactive.stp5720644editdlrm
sizeof_interactive.txt1540644editdlrm
socket-events.meta5630644editdlrm
socket-events.stp54510755editdlrm
stopwatches.meta8600644editdlrm
stopwatches.stp9570755editdlrm
tcl-funtop.meta4790644editdlrm
tcl-funtop.stp8170755editdlrm
tcl-trace.meta3640644editdlrm
tcl-trace.stp10370755editdlrm
varwatch.meta5830644editdlrm
varwatch.stp4590755editdlrm
varwatch.txt26780644editdlrm
watchdog.meta9220644editdlrm
watchdog.stp4470755editdlrm
whythefail.meta4810644editdlrm
whythefail.stp22770644editdlrm
whythefail.txt37900644editdlrm
Edit: /usr/share/systemtap/examples/general/whythefail.txt (3790B)
Some sample uses of whythefail.stp: ------------------------------------------------------------------------ Trace failing cases of do_sys_open, the main outer function behind the the open(2) syscall. # stap whythefail.stp kernel do_sys_open '$return < 0' -c 'cat /root/no-such-file || true' cat: /root/no-such-file: No such file or directory cat[23342] kernel function(do_sys_open) $return: -2 cat[23342] fs/open.c:992 $$vars: dfd=0xffffffffffffff9c filename=0x7ffc0f9546b9 flags=0x8000 mode=? op={...} fd=? tmp=? cat[23342] fs/open.c:993 $$vars: dfd=0xffffffffffffff9c filename=? flags=0x8000 mode=? op={...} fd=? tmp=0xffff88002b21d000 cat[23342] fs/open.c:996 $$vars: dfd=0xffffffffffffff9c filename=? flags=0x8000 mode=? op={...} fd=? tmp=0xffff88002b21d000 cat[23342] fs/open.c:997 $$vars: dfd=0xffffffffffffff9c filename=? flags=0x8000 mode=? op={...} fd=? tmp=0xffff88002b21d000 cat[23342] fs/open.c:998 $$vars: f=? dfd=0xffffffffffffff9c filename=? flags=? mode=? op={...} fd=0x3 tmp=0xffff88002b21d000 cat[23342] fs/open.c:999 $$vars: f=? dfd=0xffffffffffffff9c filename=? flags=? mode=? op={...} fd=0x3 tmp=0xffff88002b21d000 cat[23342] fs/open.c:1000 $$vars: f=0xfffffffffffffffe dfd=? filename=? flags=? mode=? op={...} fd=0x3 tmp=0xffff88002b21d000 cat[23342] fs/open.c:1001 $$vars: f=0xfffffffffffffffe dfd=? filename=? flags=? mode=? op={...} fd=0x3 tmp=0xffff88002b21d000 cat[23342] fs/open.c:1007 $$vars: dfd=? filename=? flags=? mode=? op={...} fd=0xfffffffffffffffe tmp=0xffff88002b21d000 cat[23342] fs/open.c:1008 $$vars: dfd=? filename=? flags=? mode=? op={...} fd=0xfffffffffffffffe tmp=0xffff88002b21d000 cat[23342] fs/open.c:1009 $$vars: dfd=? filename=? flags=? mode=? op={...} fd=? tmp=? [... 6 other traces ...] statistics: entry count: 19 exit-hit count: 7 exit-miss count: 12 statement count: 216 ------------------------------------------------------------------------ Take a random sampling of do_select runs. Print a dummy non-existent variable at the end, because the default '$$vars' is too long. Also, disable overload-prevention since select(2) is very heavily used; might even need a larger -DMAXMAPENTRIES=num and smaller -DMAXSTRINGLEN=num set. Note that the line numbers shown allow a pretty good after-the-fact trace of what happened. # stap -g --suppress-time-limits whythefail.stp kernel do_select 'randint(1000)<1' '$foo' [...] Xorg.bin[2360] kernel function(do_select) $return: 1 Xorg.bin[2360] fs/select.c:410 $foo: ? Xorg.bin[2360] fs/select.c:413 $foo: ? Xorg.bin[2360] fs/select.c:419 $foo: ? Xorg.bin[2360] fs/select.c:425 $foo: ? Xorg.bin[2360] fs/select.c:424 $foo: ? Xorg.bin[2360] fs/select.c:407 $foo: ? Xorg.bin[2360] fs/select.c:401 $foo: ? Xorg.bin[2360] fs/select.c:432 $foo: ? Xorg.bin[2360] fs/select.c:435 $foo: ? Xorg.bin[2360] fs/select.c:433 $foo: ? Xorg.bin[2360] fs/select.c:439 $foo: ? Xorg.bin[2360] fs/select.c:440 $foo: ? Xorg.bin[2360] fs/select.c:441 $foo: ? Xorg.bin[2360] fs/select.c:448 $foo: ? Xorg.bin[2360] fs/select.c:450 $foo: ? Xorg.bin[2360] fs/select.c:446 $foo: ? Xorg.bin[2360] fs/select.c:450 $foo: ? Xorg.bin[2360] fs/select.c:453 $foo: ? Xorg.bin[2360] fs/select.c:457 $foo: ? Xorg.bin[2360] fs/select.c:460 $foo: ? Xorg.bin[2360] fs/select.c:463 $foo: ? Xorg.bin[2360] fs/select.c:468 $foo: ? Xorg.bin[2360] fs/select.c:473 $foo: ? [...] Xorg.bin[2360] fs/select.c:493 $foo: ? Xorg.bin[2360] fs/select.c:494 $foo: ? Xorg.bin[2360] fs/select.c:496 $foo: ? Xorg.bin[2360] fs/select.c:498 $foo: ? Xorg.bin[2360] fs/select.c:501 $foo: ? Xorg.bin[2360] fs/select.c:500 $foo: ? Xorg.bin[2360] fs/select.c:534 $foo: ? Xorg.bin[2360] fs/select.c:536 $foo: ? Xorg.bin[2360] fs/select.c:537 $foo: ? ^C statistics: entry count: 9261 exit-hit count: 8 exit-miss count: 9231 statement count: 3427078