doc/SystemTap_Beginners_Guide/testsuite/systemtap.base/stapsh-unix.stp
raw| 1 | probe begin { |
| 2 | println(pp()) |
| 3 | |
| 4 | // Print our process chain, should be stapio, stapsh, socat |
| 5 | for (t = task_current(); t && task_parent(t) != t; |
| 6 | t = task_parent(t)) { |
| 7 | name = task_execname(t) |
| 8 | println("^ ", name) |
| 9 | if (name == "socat") { |
| 10 | break |
| 11 | } |
| 12 | } |
| 13 | } |
| 14 | |
| 15 | probe timer.s(1) { |
| 16 | println(pp()) |
| 17 | exit() |
| 18 | } |
| 19 | |
| 20 | probe timer.s(10) { |
| 21 | println(pp()) |
| 22 | println("timeout!") |
| 23 | exit() |
| 24 | } |
| 25 | |
| 26 | probe end { |
| 27 | println(pp()) |
| 28 | } |