]> sourceware.org Git - systemtap.git/commitdiff
stapbpf: remove hardware perf events dependency.
authorAaron Merey <amerey@redhat.com>
Tue, 17 Oct 2017 00:08:17 +0000 (20:08 -0400)
committerAaron Merey <amerey@redhat.com>
Tue, 17 Oct 2017 00:22:35 +0000 (20:22 -0400)
* stapbpf.cxx (create_group_fds): change perf event group leader
  from hardware type to software type.

* bpf_tests/context_vars1.stp: remove unused variable.

* bpf_tests/printf.stp: ensure kernel probe only triggers once.

stapbpf/stapbpf.cxx
testsuite/systemtap.bpf/bpf_tests/context_vars1.stp
testsuite/systemtap.bpf/bpf_tests/printf.stp

index 89acee908fb80c5a7b9323d275a5dbe027629bc3..72ca630492e29c12366776ff2b6d8b1c8051d984 100644 (file)
@@ -143,6 +143,8 @@ create_group_fds()
   memset(&peattr, 0, sizeof(peattr));
   peattr.size = sizeof(peattr);
   peattr.disabled = 1;
+  peattr.type = PERF_TYPE_SOFTWARE;
+  peattr.config = PERF_COUNT_SW_DUMMY;
 
   return group_fd = perf_event_open(&peattr, -1, 0, -1, 0);
 }
index 9f736081d7e5e51b05bbc44476de9e49a2a7c555..8c422c2267206806699ecc4d08e1416abdaf5041 100644 (file)
@@ -1,4 +1,3 @@
-global res1
 probe begin {
        printf("BEGIN\n")
 }
index 6cf6a7e1bbc7c944ff28f8f3dfd51402cf22c426..ce114e4a6d1721a2fbd418e5f3c0ff7c41740754 100644 (file)
@@ -1,4 +1,4 @@
-global x
+global x, flag = 1
 probe begin {
        printf("BEGIN")
        x = 1; y = 1; z = 3
@@ -7,10 +7,13 @@ probe begin {
 }
 
 probe kernel.function("sys_open") {
-        y = 1; z = 3
-        printf("abcd%d2", x)
-        printf("%d4%d%d", x + 2, y + 4, z + 3)
-       exit()
+       if (flag) {
+               y = 1; z = 3
+               printf("abcd%d2", x)
+               printf("%d4%d%d", x + 2, y + 4, z + 3)
+               flag = 0
+               exit()
+       }
 }
 
 
This page took 0.062709 seconds and 5 git commands to generate.