aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/bpf/progs/test_send_signal_kern.c
diff options
context:
space:
mode:
authorAndrii Nakryiko <andriin@fb.com>2019-06-17 12:26:58 -0700
committerDaniel Borkmann <daniel@iogearbox.net>2019-06-18 00:10:43 +0200
commitf654407481e9bbba7039e939163ef60f9d5e43ba (patch)
treea8acac8f4ce52706b7f74e7ea2bc7be111bcacef /tools/testing/selftests/bpf/progs/test_send_signal_kern.c
parentselftests/bpf: add test for BTF-defined maps (diff)
downloadlinux-dev-f654407481e9bbba7039e939163ef60f9d5e43ba.tar.xz
linux-dev-f654407481e9bbba7039e939163ef60f9d5e43ba.zip
selftests/bpf: switch BPF_ANNOTATE_KV_PAIR tests to BTF-defined maps
Switch tests that already rely on BTF to BTF-defined map definitions. Signed-off-by: Andrii Nakryiko <andriin@fb.com> Acked-by: Song Liu <songliubraving@fb.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'tools/testing/selftests/bpf/progs/test_send_signal_kern.c')
-rw-r--r--tools/testing/selftests/bpf/progs/test_send_signal_kern.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/tools/testing/selftests/bpf/progs/test_send_signal_kern.c b/tools/testing/selftests/bpf/progs/test_send_signal_kern.c
index 45a1a1a2c345..6ac68be5d68b 100644
--- a/tools/testing/selftests/bpf/progs/test_send_signal_kern.c
+++ b/tools/testing/selftests/bpf/progs/test_send_signal_kern.c
@@ -4,24 +4,26 @@
#include <linux/version.h>
#include "bpf_helpers.h"
-struct bpf_map_def SEC("maps") info_map = {
+struct {
+ __u32 type;
+ __u32 max_entries;
+ __u32 *key;
+ __u64 *value;
+} info_map SEC(".maps") = {
.type = BPF_MAP_TYPE_ARRAY,
- .key_size = sizeof(__u32),
- .value_size = sizeof(__u64),
.max_entries = 1,
};
-BPF_ANNOTATE_KV_PAIR(info_map, __u32, __u64);
-
-struct bpf_map_def SEC("maps") status_map = {
+struct {
+ __u32 type;
+ __u32 max_entries;
+ __u32 *key;
+ __u64 *value;
+} status_map SEC(".maps") = {
.type = BPF_MAP_TYPE_ARRAY,
- .key_size = sizeof(__u32),
- .value_size = sizeof(__u64),
.max_entries = 1,
};
-BPF_ANNOTATE_KV_PAIR(status_map, __u32, __u64);
-
SEC("send_signal_demo")
int bpf_send_signal_test(void *ctx)
{