aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/tests/bpf-script-example.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <[email protected]>2018-01-04 15:43:32 +0000
committerArnaldo Carvalho de Melo <[email protected]>2018-01-08 14:11:57 +0000
commite0337f4f9aff60a19079b0f224136bb03877db58 (patch)
tree3c477a28e1184121c76962fe55ed43097bc59fc2 /tools/perf/tests/bpf-script-example.c
parentperf test bpf: Use designated struct field initializers (diff)
downloadkernel-e0337f4f9aff60a19079b0f224136bb03877db58.tar.gz
kernel-e0337f4f9aff60a19079b0f224136bb03877db58.zip
perf test bpf: Hook on epoll_pwait()
The 'perf test bpf' was hooking a eBPF program on the SyS_epoll_wait() kernel function, that was what the epoll_wait() glibc function ended up calling, but since at least glibc 2.26, the one that comes with, for instance, Fedora 27, glibc ends up calling SyS_epoll_pwait() when epoll_wait() is used, causing this 'perf test' entry to fail. So switch to using epoll_pwait() and hook the eBPF program to the SyS_epoll_pwait() kernel function to make it work on a wider range of glibc and kernel versions. Tested-by: Wang Nan <[email protected]> Cc: Adrian Hunter <[email protected]> Cc: David Ahern <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Namhyung Kim <[email protected]> Link: https://lkml.kernel.org/n/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
Diffstat (limited to 'tools/perf/tests/bpf-script-example.c')
-rw-r--r--tools/perf/tests/bpf-script-example.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/perf/tests/bpf-script-example.c b/tools/perf/tests/bpf-script-example.c
index 268e5f8e4aa2..e4123c1b0e88 100644
--- a/tools/perf/tests/bpf-script-example.c
+++ b/tools/perf/tests/bpf-script-example.c
@@ -31,8 +31,8 @@ struct bpf_map_def SEC("maps") flip_table = {
.max_entries = 1,
};
-SEC("func=SyS_epoll_wait")
-int bpf_func__SyS_epoll_wait(void *ctx)
+SEC("func=SyS_epoll_pwait")
+int bpf_func__SyS_epoll_pwait(void *ctx)
{
int ind =0;
int *flag = bpf_map_lookup_elem(&flip_table, &ind);