]> sourceware.org Git - systemtap.git/commitdiff
Add a test for the BPF raw tracepoints functionality. (PR23866)
authorWilliam Cohen <wcohen@redhat.com>
Thu, 18 Jul 2019 15:57:50 +0000 (11:57 -0400)
committerWilliam Cohen <wcohen@redhat.com>
Thu, 18 Jul 2019 15:57:50 +0000 (11:57 -0400)
testsuite/systemtap.bpf/bpf_tests/raw_tracepoint1.stp [new file with mode: 0644]

diff --git a/testsuite/systemtap.bpf/bpf_tests/raw_tracepoint1.stp b/testsuite/systemtap.bpf/bpf_tests/raw_tracepoint1.stp
new file mode 100644 (file)
index 0000000..9ed5de8
--- /dev/null
@@ -0,0 +1,24 @@
+global flag
+
+probe begin {
+       printf("BEGIN\n")
+}
+
+probe kernel.trace("sched:sched_switch") {
+        // look for the process with pid 0 and name that begins with "swap"
+        if ($next->comm[0] == 115 && $next->comm[1] == 119
+            && $next->comm[2] == 97 && $next->comm[3] == 112
+           && $next->pid == 0)
+               flag = 1
+}
+
+probe timer.s(5) {
+       exit()
+}
+
+probe end {
+       if (flag)
+               printf("END PASS\n")
+       else
+               printf("END FAIL\n")
+}
This page took 0.028848 seconds and 5 git commands to generate.