diff options
author | Jean-Philippe Brucker <jean-philippe@linaro.org> | 2021-09-06 17:36:38 +0100 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2021-09-07 17:23:19 +0200 |
commit | 3a029e1f3d6e2ee809e85abecce619a48016bd4b (patch) | |
tree | 148c398b99ac7f954aa7a3b19bc402e9e48c1424 /tools/testing/selftests/bpf/prog_tests/task_pt_regs.c | |
parent | 49ca6153208f6efc409c1deb82dd5bcbb519d7e1 (diff) |
selftests/bpf: Fix build of task_pt_regs test for arm64
struct pt_regs is not exported to userspace on all archs. arm64 and s390
export "user_pt_regs" instead, which causes build failure at the moment:
progs/test_task_pt_regs.c:8:16: error: variable has incomplete type 'struct pt_regs'
struct pt_regs current_regs = {};
Instead of using pt_regs from ptrace.h, use the larger kernel struct
from vmlinux.h directly. Since the test runner task_pt_regs.c does not
have access to the kernel struct definition, copy it into a char array.
Fixes: 576d47bb1a92 ("bpf: selftests: Add bpf_task_pt_regs() selftest")
Suggested-by: Andrii Nakryiko <andrii.nakryiko@gmail.com>
Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Tested-by: Ilya Leoshkevich <iii@linux.ibm.com>
Acked-by: Ilya Leoshkevich <iii@linux.ibm.com>
Link: https://lore.kernel.org/bpf/20210906163635.302307-1-jean-philippe@linaro.org
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/task_pt_regs.c')
-rw-r--r-- | tools/testing/selftests/bpf/prog_tests/task_pt_regs.c | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/tools/testing/selftests/bpf/prog_tests/task_pt_regs.c b/tools/testing/selftests/bpf/prog_tests/task_pt_regs.c index 53f0e0fa1a53..37c20b5ffa70 100644 --- a/tools/testing/selftests/bpf/prog_tests/task_pt_regs.c +++ b/tools/testing/selftests/bpf/prog_tests/task_pt_regs.c @@ -1,7 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 #define _GNU_SOURCE #include <test_progs.h> -#include <linux/ptrace.h> #include "test_task_pt_regs.skel.h" void test_task_pt_regs(void) |