selftests/bpf: add __uint and __type macro for BTF-defined maps

Add simple __uint and __type macro that hide details of how type and
integer values are captured in BTF-defined maps.

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>
This commit is contained in:
Andrii Nakryiko 2019-07-05 08:50:10 -07:00 committed by Daniel Borkmann
parent ef99b02b23
commit 00acd00814
1 changed files with 3 additions and 0 deletions

View File

@ -8,6 +8,9 @@
*/
#define SEC(NAME) __attribute__((section(NAME), used))
#define __uint(name, val) int (*name)[val]
#define __type(name, val) val *name
/* helper macro to print out debug messages */
#define bpf_printk(fmt, ...) \
({ \