[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190628152539.3014719-3-andriin@fb.com>
Date: Fri, 28 Jun 2019 08:25:37 -0700
From: Andrii Nakryiko <andriin@...com>
To: <andrii.nakryiko@...il.com>, <ast@...com>, <daniel@...earbox.net>,
<bpf@...r.kernel.org>, <netdev@...r.kernel.org>,
<songliubraving@...com>
CC: Andrii Nakryiko <andriin@...com>
Subject: [PATCH v2 bpf-next 2/4] selftests/bpf: add __int and __type macro for BTF-defined maps
Add simple __int and __type macro that hide details of how type and
integer values are captured in BTF-defined maps.
Signed-off-by: Andrii Nakryiko <andriin@...com>
---
tools/testing/selftests/bpf/bpf_helpers.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/tools/testing/selftests/bpf/bpf_helpers.h b/tools/testing/selftests/bpf/bpf_helpers.h
index 1a5b1accf091..aa5ddf58c088 100644
--- a/tools/testing/selftests/bpf/bpf_helpers.h
+++ b/tools/testing/selftests/bpf/bpf_helpers.h
@@ -8,6 +8,9 @@
*/
#define SEC(NAME) __attribute__((section(NAME), used))
+#define __int(name, val) int (*name)[val]
+#define __type(name, val) val *name
+
/* helper macro to print out debug messages */
#define bpf_printk(fmt, ...) \
({ \
--
2.17.1
Powered by blists - more mailing lists