diff options
author | Andrii Nakryiko <andrii@kernel.org> | 2020-12-02 09:52:42 +0300 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2020-12-03 21:17:26 +0300 |
commit | 0cfdcd6378071f383c900e3d8862347e2af1d1ca (patch) | |
tree | 5e2ca63005890b314498b46f6470d42216392202 /tools/lib/bpf/btf.c | |
parent | 71ccb50074f31a50a1da4c1d8306d54da0907b00 (diff) | |
download | linux-0cfdcd6378071f383c900e3d8862347e2af1d1ca.tar.xz |
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.c')
-rw-r--r-- | tools/lib/bpf/btf.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/lib/bpf/btf.c b/tools/lib/bpf/btf.c index 8ff46cd30ca1..1935e83d309c 100644 --- a/tools/lib/bpf/btf.c +++ b/tools/lib/bpf/btf.c @@ -432,6 +432,11 @@ __u32 btf__get_nr_types(const struct btf *btf) return btf->start_id + btf->nr_types - 1; } +const struct btf *btf__base_btf(const struct btf *btf) +{ + return btf->base_btf; +} + /* internal helper returning non-const pointer to a type */ static struct btf_type *btf_type_by_id(struct btf *btf, __u32 type_id) { |