doc/SystemTap_Beginners_Guide/testsuite/systemtap.bpf/bpf_tests/printf.stp
raw| 1 | global x |
| 2 | |
| 3 | @define test_print |
| 4 | %( |
| 5 | printf("abcd%d2", x) |
| 6 | printf("%d4%d%d", x + 2, y + 4, z + 3) |
| 7 | %) |
| 8 | |
| 9 | probe begin { |
| 10 | printf("BEGIN") |
| 11 | x = 1; y = 1; z = 3 |
| 12 | @test_print |
| 13 | } |
| 14 | |
| 15 | probe kernel.function("vfs_read") { |
| 16 | y = 1; z = 3 |
| 17 | @test_print |
| 18 | exit() |
| 19 | } |
| 20 | |
| 21 | |
| 22 | probe end { |
| 23 | y = 1; z = 3 |
| 24 | @test_print |
| 25 | printf("END\n") |
| 26 | } |