perf test bpf: Hook on epoll_pwait()
authorArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 4 Jan 2018 15:43:32 +0000 (12:43 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 8 Jan 2018 14:11:57 +0000 (11:11 -0300)
commite0337f4f9aff60a19079b0f224136bb03877db58
tree3c477a28e1184121c76962fe55ed43097bc59fc2
parent13cb2d0f513cf35bf74484a392f745f9e9c5a3f2
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 <wangnan0@huawei.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: https://lkml.kernel.org/n/tip-zynvquy63er8s5mrgsz65pto@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/tests/bpf-script-example.c
tools/perf/tests/bpf.c