diff options
author | Andrii Nakryiko <andriin@fb.com> | 2019-07-05 08:50:11 -0700 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2019-07-05 22:52:25 +0200 |
commit | bc7430cc8bfb51577e466a8ca02ad87375a70bde (patch) | |
tree | c56b050f3bb07c491da3f0fa082e651dbfe6d993 /tools/testing/selftests/bpf/progs/test_btf_newkv.c | |
parent | selftests/bpf: add __uint and __type macro for BTF-defined maps (diff) | |
download | linux-dev-bc7430cc8bfb51577e466a8ca02ad87375a70bde.tar.xz linux-dev-bc7430cc8bfb51577e466a8ca02ad87375a70bde.zip |
selftests/bpf: convert selftests using BTF-defined maps to new syntax
Convert all the existing selftests that are already using BTF-defined
maps to use new syntax (with no static data initialization).
Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Acked-by: Song Liu <songliubraving@fb.com>
Acked-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'tools/testing/selftests/bpf/progs/test_btf_newkv.c')
-rw-r--r-- | tools/testing/selftests/bpf/progs/test_btf_newkv.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/tools/testing/selftests/bpf/progs/test_btf_newkv.c b/tools/testing/selftests/bpf/progs/test_btf_newkv.c index 28c16bb583b6..5ee3622ddebb 100644 --- a/tools/testing/selftests/bpf/progs/test_btf_newkv.c +++ b/tools/testing/selftests/bpf/progs/test_btf_newkv.c @@ -21,14 +21,11 @@ struct bpf_map_def SEC("maps") btf_map_legacy = { BPF_ANNOTATE_KV_PAIR(btf_map_legacy, int, struct ipv_counts); struct { - int *key; - struct ipv_counts *value; - unsigned int type; - unsigned int max_entries; -} btf_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, struct ipv_counts); +} btf_map SEC(".maps"); struct dummy_tracepoint_args { unsigned long long pad; |