summaryrefslogtreecommitdiffstats
path: root/tools/lib/bpf/btf.c
diff options
context:
space:
mode:
authorYonghong Song <yhs@fb.com>2021-09-14 15:30:15 -0700
committerAlexei Starovoitov <ast@kernel.org>2021-09-14 18:45:52 -0700
commitb5ea834dde6b6e7f75e51d5f66dac8cd7c97b5ef (patch)
treeb82684f92084ac8a9c1f81e860e478db4f558283 /tools/lib/bpf/btf.c
parent41ced4cd88020c9d4b71ff7c50d020f081efa4a0 (diff)
downloadlinux-b5ea834dde6b6e7f75e51d5f66dac8cd7c97b5ef.tar.bz2
bpf: Support for new btf kind BTF_KIND_TAG
LLVM14 added support for a new C attribute ([1]) __attribute__((btf_tag("arbitrary_str"))) This attribute will be emitted to dwarf ([2]) and pahole will convert it to BTF. Or for bpf target, this attribute will be emitted to BTF directly ([3], [4]). The attribute is intended to provide additional information for - struct/union type or struct/union member - static/global variables - static/global function or function parameter. For linux kernel, the btf_tag can be applied in various places to specify user pointer, function pre- or post- condition, function allow/deny in certain context, etc. Such information will be encoded in vmlinux BTF and can be used by verifier. The btf_tag can also be applied to bpf programs to help global verifiable functions, e.g., specifying preconditions, etc. This patch added basic parsing and checking support in kernel for new BTF_KIND_TAG kind. [1] https://reviews.llvm.org/D106614 [2] https://reviews.llvm.org/D106621 [3] https://reviews.llvm.org/D106622 [4] https://reviews.llvm.org/D109560 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/20210914223015.245546-1-yhs@fb.com
Diffstat (limited to 'tools/lib/bpf/btf.c')
0 files changed, 0 insertions, 0 deletions