doc/SystemTap_Beginners_Guide/testsuite/systemtap.base/try_assign.stp
raw| 1 | #!/usr/bin/env stap |
| 2 | |
| 3 | function func (a){ |
| 4 | if (a == 1) |
| 5 | error("This message should not appear") |
| 6 | else |
| 7 | return "systemtap test success" |
| 8 | } |
| 9 | |
| 10 | probe begin { |
| 11 | println("systemtap starting probe") |
| 12 | exit() |
| 13 | } |
| 14 | probe end { |
| 15 | println("systemtap ending probe") |
| 16 | @try_assign(msg, func(1), func(0)) |
| 17 | println(msg) |
| 18 | } |