* 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.
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);
}
-global res1
probe begin {
printf("BEGIN\n")
}
-global x
+global x, flag = 1
probe begin {
printf("BEGIN")
x = 1; y = 1; z = 3
}
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()
+ }
}