doc/SystemTap_Beginners_Guide/testsuite/systemtap.base/alias-condition.stp
raw| 1 | /* |
| 2 | * alias-condition.stp |
| 3 | * |
| 4 | * Check that conditions are copied correctly across aliases |
| 5 | */ |
| 6 | |
| 7 | /* x should be incremented exactly once */ |
| 8 | global x = 0 |
| 9 | probe foo = begin { } |
| 10 | probe foo if (x < 0), foo { ++x } |
| 11 | |
| 12 | probe begin(1) |
| 13 | { |
| 14 | println("systemtap starting probe") |
| 15 | exit() |
| 16 | } |
| 17 | |
| 18 | probe end |
| 19 | { |
| 20 | println("systemtap ending probe") |
| 21 | if ( x != 1 ) { |
| 22 | println("systemtap test failure") |
| 23 | } else { |
| 24 | println("systemtap test success") |
| 25 | } |
| 26 | } |