doc/SystemTap_Beginners_Guide/testsuite/systemtap.bpf/bpf_tests/logging1.stp
raw| 1 | // stapbpf string manipulation -- logging tapset functions |
| 2 | |
| 3 | probe begin { |
| 4 | printf("BEGIN\n") |
| 5 | log("(1) a message") |
| 6 | warn("(1) a warning") |
| 7 | warn("(1) a warning with newline\n") |
| 8 | } |
| 9 | |
| 10 | probe kernel.function("vfs_read") { |
| 11 | log("(2) a message") |
| 12 | warn("(2) a warning") |
| 13 | warn("(2) a warning with newline\n") |
| 14 | assert(0, "failed assertion (supposed to happen when testing)") |
| 15 | } |
| 16 | |
| 17 | probe error { |
| 18 | printf("END PASS\n") |
| 19 | } |