mirror of
https://github.com/netdata/libbpf.git
synced 2026-03-23 09:49:07 +08:00
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
This commit is contained in:
committed by
Andrii Nakryiko
parent
65e4be6f5d
commit
a741bc6479
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user