From: William Cohen Date: Thu, 18 Jul 2019 15:57:50 +0000 (-0400) Subject: Add a test for the BPF raw tracepoints functionality. (PR23866) X-Git-Tag: release-4.2~70 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=a45a7fae60bd18148739aef8da2dd12a8b51debe;p=systemtap.git Add a test for the BPF raw tracepoints functionality. (PR23866) --- diff --git a/testsuite/systemtap.bpf/bpf_tests/raw_tracepoint1.stp b/testsuite/systemtap.bpf/bpf_tests/raw_tracepoint1.stp new file mode 100644 index 000000000..9ed5de8f0 --- /dev/null +++ b/testsuite/systemtap.bpf/bpf_tests/raw_tracepoint1.stp @@ -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") +}