]> git.baikalelectronics.ru Git - kernel.git/commit
libbpf: Introduce bpf_object__btf
authorAndrey Ignatov <rdna@fb.com>
Thu, 14 Feb 2019 23:01:43 +0000 (15:01 -0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Fri, 15 Feb 2019 14:20:54 +0000 (15:20 +0100)
commitc9000c194f142fcdc6d8ef824a8e4708c8b17185
tree376d9ca0066237549b9fca7c81001bbf517f9967
parent5e7688d2a6ff44a66eedfcc6f319286378c632a3
libbpf: Introduce bpf_object__btf

Add new accessor for bpf_object to get opaque struct btf * from it.

struct btf * is needed for all operations with BTF and it's present in
bpf_object. The only thing missing is a way to get it.

Example use-case is to get BTF key_type_id and value_type_id for a map in
bpf_object. It can be done with btf__get_map_kv_tids() but that function
requires struct btf *.

Similar API can be added for struct btf_ext but no use-case for it yet.

Signed-off-by: Andrey Ignatov <rdna@fb.com>
Acked-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
tools/lib/bpf/libbpf.c
tools/lib/bpf/libbpf.h
tools/lib/bpf/libbpf.map