summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/bpf/prog_tests/perf_buffer.c
diff options
context:
space:
mode:
authorIlya Leoshkevich <iii@linux.ibm.com>2019-07-16 14:58:27 +0200
committerAlexei Starovoitov <ast@kernel.org>2019-07-16 18:41:00 -0700
commit1cb59a6074e23c6f6513642f752a6d8d38327354 (patch)
tree36d4796a2deccacc5a17ddb00d63d4199a36c7c8 /tools/testing/selftests/bpf/prog_tests/perf_buffer.c
parent9d1f62a6dcf0de3ab184c1f7b7d82117dcbab090 (diff)
downloadlinux-1cb59a6074e23c6f6513642f752a6d8d38327354.tar.gz
selftests/bpf: fix perf_buffer on s390
perf_buffer test fails for exactly the same reason test_attach_probe used to fail: different nanosleep syscall kprobe name. Reuse the test_attach_probe fix. Fixes: ee5cf82ce04a ("selftests/bpf: test perf buffer API") Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com> Acked-by: Andrii Nakryiko <andriin@fb.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/perf_buffer.c')
-rw-r--r--tools/testing/selftests/bpf/prog_tests/perf_buffer.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/tools/testing/selftests/bpf/prog_tests/perf_buffer.c b/tools/testing/selftests/bpf/prog_tests/perf_buffer.c
index 3f1ef95865ff..3003fddc0613 100644
--- a/tools/testing/selftests/bpf/prog_tests/perf_buffer.c
+++ b/tools/testing/selftests/bpf/prog_tests/perf_buffer.c
@@ -5,12 +5,6 @@
#include <sys/socket.h>
#include <test_progs.h>
-#ifdef __x86_64__
-#define SYS_KPROBE_NAME "__x64_sys_nanosleep"
-#else
-#define SYS_KPROBE_NAME "sys_nanosleep"
-#endif
-
static void on_sample(void *ctx, int cpu, void *data, __u32 size)
{
int cpu_data = *(int *)data, duration = 0;
@@ -56,7 +50,7 @@ void test_perf_buffer(void)
/* attach kprobe */
link = bpf_program__attach_kprobe(prog, false /* retprobe */,
- SYS_KPROBE_NAME);
+ SYS_NANOSLEEP_KPROBE_NAME);
if (CHECK(IS_ERR(link), "attach_kprobe", "err %ld\n", PTR_ERR(link)))
goto out_close;