]> git.baikalelectronics.ru Git - kernel.git/commit
libbpf: Add btf__load_vmlinux_btf/btf__load_module_btf
authorHengqi Chen <hengqi.chen@gmail.com>
Fri, 30 Jul 2021 11:40:12 +0000 (19:40 +0800)
committerAndrii Nakryiko <andrii@kernel.org>
Fri, 30 Jul 2021 19:21:29 +0000 (12:21 -0700)
commitfa989992fb80b215b83903114d1a8f4161def6de
treec69f420d037fc6bd50a4cf774c44ab30b218d1ca
parentc580b9cc79f92b055d94b72b9e3fac95d33b5b2f
libbpf: Add btf__load_vmlinux_btf/btf__load_module_btf

Add two new APIs: btf__load_vmlinux_btf and btf__load_module_btf.
btf__load_vmlinux_btf is just an alias to the existing API named
libbpf_find_kernel_btf, rename to be more precisely and consistent
with existing BTF APIs. btf__load_module_btf can be used to load
module BTF, add it for completeness. These two APIs are useful for
implementing tracing tools and introspection tools. This is part
of the effort towards libbpf 1.0 ([0]).

  [0] Closes: https://github.com/libbpf/libbpf/issues/280

Signed-off-by: Hengqi Chen <hengqi.chen@gmail.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20210730114012.494408-1-hengqi.chen@gmail.com
tools/lib/bpf/btf.c
tools/lib/bpf/btf.h
tools/lib/bpf/libbpf.c
tools/lib/bpf/libbpf.map