mirror of
https://github.com/netdata/libbpf.git
synced 2026-03-28 20:29:07 +08:00
libbpf: Expose btf_type_by_id() internally
btf_type_by_id() is internal-only convenience API returning non-const pointer to struct btf_type. Expose it outside of btf.c for re-use. Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Link: https://lore.kernel.org/bpf/20210318194036.3521577-2-andrii@kernel.org
This commit is contained in:
committed by
Andrii Nakryiko
parent
75a2e3bda8
commit
082a5c6020
@@ -435,7 +435,7 @@ const struct btf *btf__base_btf(const struct btf *btf)
|
||||
}
|
||||
|
||||
/* internal helper returning non-const pointer to a type */
|
||||
static struct btf_type *btf_type_by_id(struct btf *btf, __u32 type_id)
|
||||
struct btf_type *btf_type_by_id(struct btf *btf, __u32 type_id)
|
||||
{
|
||||
if (type_id == 0)
|
||||
return &btf_void;
|
||||
|
||||
Reference in New Issue
Block a user