This patchset changes existing btf__new() API call to only load and initialize struct btf, while exposing new btf__load() API to attempt to load and validate BTF in kernel. It also adds ability to copy raw BTF data out of struct btf for further processing by external applications.
This makes utilizing libbpf's APIs that don't require kernel facilities (e.g., btf_dedup) simpler and more natural from external application. Andrii Nakryiko (2): btf: separate btf creation and loading btf: expose API to work with raw btf data tools/lib/bpf/btf.c | 63 +++++++++++++++++++++++++--------------- tools/lib/bpf/btf.h | 3 ++ tools/lib/bpf/libbpf.c | 2 +- tools/lib/bpf/libbpf.map | 3 ++ 4 files changed, 46 insertions(+), 25 deletions(-) -- 2.17.1