summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/bpf/test_btf.h
diff options
context:
space:
mode:
authorEduard Zingerman <eddyz87@gmail.com>2022-06-21 02:53:41 +0300
committerAlexei Starovoitov <ast@kernel.org>2022-06-21 03:40:51 +0300
commit7a42008ca5c700819e4b3003025e5e1695fd1f86 (patch)
tree54db99e20fe60b2de5383c0e517fafc26be04745 /tools/testing/selftests/bpf/test_btf.h
parent933ff53191eb7a8492370bad6339a1ca6da2d939 (diff)
downloadlinux-7a42008ca5c700819e4b3003025e5e1695fd1f86.tar.xz
selftests/bpf: allow BTF specs and func infos in test_verifier tests
The BTF and func_info specification for test_verifier tests follows the same notation as in prog_tests/btf.c tests. E.g.: ... .func_info = { { 0, 6 }, { 8, 7 } }, .func_info_cnt = 2, .btf_strings = "\0int\0", .btf_types = { BTF_TYPE_INT_ENC(1, BTF_INT_SIGNED, 0, 32, 4), BTF_PTR_ENC(1), }, ... The BTF specification is loaded only when specified. Signed-off-by: Eduard Zingerman <eddyz87@gmail.com> Acked-by: Song Liu <songliubraving@fb.com> Link: https://lore.kernel.org/r/20220620235344.569325-3-eddyz87@gmail.com Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/testing/selftests/bpf/test_btf.h')
-rw-r--r--tools/testing/selftests/bpf/test_btf.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/testing/selftests/bpf/test_btf.h b/tools/testing/selftests/bpf/test_btf.h
index 38782bd47fdc..fb4f4714eeb4 100644
--- a/tools/testing/selftests/bpf/test_btf.h
+++ b/tools/testing/selftests/bpf/test_btf.h
@@ -4,6 +4,8 @@
#ifndef _TEST_BTF_H
#define _TEST_BTF_H
+#define BTF_END_RAW 0xdeadbeef
+
#define BTF_INFO_ENC(kind, kind_flag, vlen) \
((!!(kind_flag) << 31) | ((kind) << 24) | ((vlen) & BTF_MAX_VLEN))