doc/SystemTap_Beginners_Guide/testsuite/systemtap.bpf/bpf_tests/bool2.stp
raw| 1 | global res |
| 2 | probe begin { |
| 3 | printf("BEGIN\n") |
| 4 | x = 1; y = 0 |
| 5 | res = (1 || 0) && (x || y) && (0 || 1) && (y || x) |
| 6 | } |
| 7 | |
| 8 | probe kernel.function("vfs_read") { |
| 9 | x = 1; y = 0 |
| 10 | res = res && (1 || 0) && (x || y) && (0 || 1) && (y || x) |
| 11 | exit() |
| 12 | } |
| 13 | |
| 14 | probe end { |
| 15 | x = 1; y = 0 |
| 16 | if (res && (1 || 0) && (x || y) && (0 || 1) && (y || x)) |
| 17 | printf("END PASS\n") |
| 18 | else |
| 19 | printf("END FAIL\n") |
| 20 | } |