aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/bpf/test_btf.h
diff options
context:
space:
mode:
authorYonghong Song <yhs@fb.com>2021-09-14 15:30:47 -0700
committerAlexei Starovoitov <ast@kernel.org>2021-09-14 18:45:52 -0700
commit35baba7a832fa466b4aa2e0d00473d795cec8f20 (patch)
tree581b5b258e63a4d5c86c037b711e70e489cf3aa2 /tools/testing/selftests/bpf/test_btf.h
parentselftests/bpf: Change NAME_NTH/IS_NAME_NTH for BTF_KIND_TAG format (diff)
downloadlinux-dev-35baba7a832fa466b4aa2e0d00473d795cec8f20.tar.xz
linux-dev-35baba7a832fa466b4aa2e0d00473d795cec8f20.zip
selftests/bpf: Add BTF_KIND_TAG unit tests
Test good and bad variants of BTF_KIND_TAG encoding. Signed-off-by: Yonghong Song <yhs@fb.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Acked-by: Andrii Nakryiko <andrii@kernel.org> Link: https://lore.kernel.org/bpf/20210914223047.248223-1-yhs@fb.com
Diffstat (limited to 'tools/testing/selftests/bpf/test_btf.h')
-rw-r--r--tools/testing/selftests/bpf/test_btf.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/testing/selftests/bpf/test_btf.h b/tools/testing/selftests/bpf/test_btf.h
index e2394eea4b7f..0619e06d745e 100644
--- a/tools/testing/selftests/bpf/test_btf.h
+++ b/tools/testing/selftests/bpf/test_btf.h
@@ -69,4 +69,7 @@
#define BTF_TYPE_FLOAT_ENC(name, sz) \
BTF_TYPE_ENC(name, BTF_INFO_ENC(BTF_KIND_FLOAT, 0, 0), sz)
+#define BTF_TAG_ENC(value, type, component_idx) \
+ BTF_TYPE_ENC(value, BTF_INFO_ENC(BTF_KIND_TAG, 0, 0), type), (component_idx)
+
#endif /* _TEST_BTF_H */