| 1 |
Some sample uses of whythefail.stp: |
| 2 |
|
| 3 |
------------------------------------------------------------------------ |
| 4 |
|
| 5 |
Trace failing cases of do_sys_open, the main outer function behind the |
| 6 |
the open(2) syscall. |
| 7 |
|
| 8 |
# stap whythefail.stp kernel do_sys_open '$return < 0' -c 'cat /root/no-such-file || true' |
| 9 |
cat: /root/no-such-file: No such file or directory |
| 10 |
|
| 11 |
cat[23342] kernel function(do_sys_open) $return: -2 |
| 12 |
cat[23342] fs/open.c:992 $$vars: dfd=0xffffffffffffff9c filename=0x7ffc0f9546b9 flags=0x8000 mode=? op={...} fd=? tmp=? |
| 13 |
cat[23342] fs/open.c:993 $$vars: dfd=0xffffffffffffff9c filename=? flags=0x8000 mode=? op={...} fd=? tmp=0xffff88002b21d000 |
| 14 |
cat[23342] fs/open.c:996 $$vars: dfd=0xffffffffffffff9c filename=? flags=0x8000 mode=? op={...} fd=? tmp=0xffff88002b21d000 |
| 15 |
cat[23342] fs/open.c:997 $$vars: dfd=0xffffffffffffff9c filename=? flags=0x8000 mode=? op={...} fd=? tmp=0xffff88002b21d000 |
| 16 |
cat[23342] fs/open.c:998 $$vars: f=? dfd=0xffffffffffffff9c filename=? flags=? mode=? op={...} fd=0x3 tmp=0xffff88002b21d000 |
| 17 |
cat[23342] fs/open.c:999 $$vars: f=? dfd=0xffffffffffffff9c filename=? flags=? mode=? op={...} fd=0x3 tmp=0xffff88002b21d000 |
| 18 |
cat[23342] fs/open.c:1000 $$vars: f=0xfffffffffffffffe dfd=? filename=? flags=? mode=? op={...} fd=0x3 tmp=0xffff88002b21d000 |
| 19 |
cat[23342] fs/open.c:1001 $$vars: f=0xfffffffffffffffe dfd=? filename=? flags=? mode=? op={...} fd=0x3 tmp=0xffff88002b21d000 |
| 20 |
cat[23342] fs/open.c:1007 $$vars: dfd=? filename=? flags=? mode=? op={...} fd=0xfffffffffffffffe tmp=0xffff88002b21d000 |
| 21 |
cat[23342] fs/open.c:1008 $$vars: dfd=? filename=? flags=? mode=? op={...} fd=0xfffffffffffffffe tmp=0xffff88002b21d000 |
| 22 |
cat[23342] fs/open.c:1009 $$vars: dfd=? filename=? flags=? mode=? op={...} fd=? tmp=? |
| 23 |
[... 6 other traces ...] |
| 24 |
|
| 25 |
statistics: |
| 26 |
entry count: 19 |
| 27 |
exit-hit count: 7 |
| 28 |
exit-miss count: 12 |
| 29 |
statement count: 216 |
| 30 |
|
| 31 |
------------------------------------------------------------------------ |
| 32 |
|
| 33 |
Take a random sampling of do_select runs. Print a dummy non-existent |
| 34 |
variable at the end, because the default '$$vars' is too long. Also, |
| 35 |
disable overload-prevention since select(2) is very heavily used; |
| 36 |
might even need a larger -DMAXMAPENTRIES=num and smaller -DMAXSTRINGLEN=num |
| 37 |
set. Note that the line numbers shown allow a pretty good |
| 38 |
after-the-fact trace of what happened. |
| 39 |
|
| 40 |
# stap -g --suppress-time-limits whythefail.stp kernel do_select 'randint(1000)<1' '$foo' |
| 41 |
[...] |
| 42 |
Xorg.bin[2360] kernel function(do_select) $return: 1 |
| 43 |
Xorg.bin[2360] fs/select.c:410 $foo: ? |
| 44 |
Xorg.bin[2360] fs/select.c:413 $foo: ? |
| 45 |
Xorg.bin[2360] fs/select.c:419 $foo: ? |
| 46 |
Xorg.bin[2360] fs/select.c:425 $foo: ? |
| 47 |
Xorg.bin[2360] fs/select.c:424 $foo: ? |
| 48 |
Xorg.bin[2360] fs/select.c:407 $foo: ? |
| 49 |
Xorg.bin[2360] fs/select.c:401 $foo: ? |
| 50 |
Xorg.bin[2360] fs/select.c:432 $foo: ? |
| 51 |
Xorg.bin[2360] fs/select.c:435 $foo: ? |
| 52 |
Xorg.bin[2360] fs/select.c:433 $foo: ? |
| 53 |
Xorg.bin[2360] fs/select.c:439 $foo: ? |
| 54 |
Xorg.bin[2360] fs/select.c:440 $foo: ? |
| 55 |
Xorg.bin[2360] fs/select.c:441 $foo: ? |
| 56 |
Xorg.bin[2360] fs/select.c:448 $foo: ? |
| 57 |
Xorg.bin[2360] fs/select.c:450 $foo: ? |
| 58 |
Xorg.bin[2360] fs/select.c:446 $foo: ? |
| 59 |
Xorg.bin[2360] fs/select.c:450 $foo: ? |
| 60 |
Xorg.bin[2360] fs/select.c:453 $foo: ? |
| 61 |
Xorg.bin[2360] fs/select.c:457 $foo: ? |
| 62 |
Xorg.bin[2360] fs/select.c:460 $foo: ? |
| 63 |
Xorg.bin[2360] fs/select.c:463 $foo: ? |
| 64 |
Xorg.bin[2360] fs/select.c:468 $foo: ? |
| 65 |
Xorg.bin[2360] fs/select.c:473 $foo: ? |
| 66 |
[...] |
| 67 |
Xorg.bin[2360] fs/select.c:493 $foo: ? |
| 68 |
Xorg.bin[2360] fs/select.c:494 $foo: ? |
| 69 |
Xorg.bin[2360] fs/select.c:496 $foo: ? |
| 70 |
Xorg.bin[2360] fs/select.c:498 $foo: ? |
| 71 |
Xorg.bin[2360] fs/select.c:501 $foo: ? |
| 72 |
Xorg.bin[2360] fs/select.c:500 $foo: ? |
| 73 |
Xorg.bin[2360] fs/select.c:534 $foo: ? |
| 74 |
Xorg.bin[2360] fs/select.c:536 $foo: ? |
| 75 |
Xorg.bin[2360] fs/select.c:537 $foo: ? |
| 76 |
^C |
| 77 |
statistics: |
| 78 |
entry count: 9261 |
| 79 |
exit-hit count: 8 |
| 80 |
exit-miss count: 9231 |
| 81 |
statement count: 3427078 |
| 82 |
|