aboutsummaryrefslogtreecommitdiffstats
path: root/tools/lib/bpf/btf.h
diff options
context:
space:
mode:
authorAndrii Nakryiko <andrii@kernel.org>2020-12-01 22:52:42 -0800
committerAlexei Starovoitov <ast@kernel.org>2020-12-03 10:17:26 -0800
commit0cfdcd6378071f383c900e3d8862347e2af1d1ca (patch)
tree5e2ca63005890b314498b46f6470d42216392202 /tools/lib/bpf/btf.h
parenttools/bpftool: Emit name <anon> for anonymous BTFs (diff)
downloadlinux-0cfdcd6378071f383c900e3d8862347e2af1d1ca.tar.xz
linux-0cfdcd6378071f383c900e3d8862347e2af1d1ca.zip
libbpf: Add base BTF accessor
Add ability to get base BTF. It can be also used to check if BTF is split BTF. Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Link: https://lore.kernel.org/bpf/20201202065244.530571-3-andrii@kernel.org
Diffstat (limited to 'tools/lib/bpf/btf.h')
-rw-r--r--tools/lib/bpf/btf.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/lib/bpf/btf.h b/tools/lib/bpf/btf.h
index 1093f6fe6800..1237bcd1dd17 100644
--- a/tools/lib/bpf/btf.h
+++ b/tools/lib/bpf/btf.h
@@ -51,6 +51,7 @@ LIBBPF_API __s32 btf__find_by_name(const struct btf *btf,
LIBBPF_API __s32 btf__find_by_name_kind(const struct btf *btf,
const char *type_name, __u32 kind);
LIBBPF_API __u32 btf__get_nr_types(const struct btf *btf);
+LIBBPF_API const struct btf *btf__base_btf(const struct btf *btf);
LIBBPF_API const struct btf_type *btf__type_by_id(const struct btf *btf,
__u32 id);
LIBBPF_API size_t btf__pointer_size(const struct btf *btf);