summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorAndrii Nakryiko <andriin@fb.com>2019-07-06 06:44:20 +0200
committerDaniel Borkmann <daniel@iogearbox.net>2019-07-08 16:25:58 +0200
commit06ec0e2c490afd2f870d89c59200540fd9acde95 (patch)
tree179a8e2b4e766458c1bd23b07eeec08b7008cd82 /tools
parentMerge branch 'bpf-sockaddr-wide-store' (diff)
downloadlinux-06ec0e2c490afd2f870d89c59200540fd9acde95.tar.xz
linux-06ec0e2c490afd2f870d89c59200540fd9acde95.zip
selftests/bpf: fix test_attach_probe map definition
ef99b02b23ef ("libbpf: capture value in BTF type info for BTF-defined map defs") changed BTF-defined maps syntax, while independently merged 1e8611bbdfc9 ("selftests/bpf: add kprobe/uprobe selftests") added new test using outdated syntax of maps. This patch fixes this test after corresponding patch sets were merged. Fixes: ef99b02b23ef ("libbpf: capture value in BTF type info for BTF-defined map defs") Fixes: 1e8611bbdfc9 ("selftests/bpf: add kprobe/uprobe selftests") Signed-off-by: Andrii Nakryiko <andriin@fb.com> Acked-by: Yonghong Song <yhs@fb.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'tools')
-rw-r--r--tools/testing/selftests/bpf/progs/test_attach_probe.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/tools/testing/selftests/bpf/progs/test_attach_probe.c b/tools/testing/selftests/bpf/progs/test_attach_probe.c
index 7a7c5cd728c8..63a8dfef893b 100644
--- a/tools/testing/selftests/bpf/progs/test_attach_probe.c
+++ b/tools/testing/selftests/bpf/progs/test_attach_probe.c
@@ -6,14 +6,11 @@
#include "bpf_helpers.h"
struct {
- int type;
- int max_entries;
- int *key;
- int *value;
-} results_map SEC(".maps") = {
- .type = BPF_MAP_TYPE_ARRAY,
- .max_entries = 4,
-};
+ __uint(type, BPF_MAP_TYPE_ARRAY);
+ __uint(max_entries, 4);
+ __type(key, int);
+ __type(value, int);
+} results_map SEC(".maps");
SEC("kprobe/sys_nanosleep")
int handle_sys_nanosleep_entry(struct pt_regs *ctx)