libbpf: Add btf__parse_raw() and generic btf__parse() APIs

Add public APIs to parse BTF from raw data file (e.g.,
/sys/kernel/btf/vmlinux), as well as generic btf__parse(), which will try to
determine correct format, currently either raw or ELF.

Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20200802013219.864880-2-andriin@fb.com
This commit is contained in:
Andrii Nakryiko
2020-08-01 18:32:17 -07:00
committed by Andrii Nakryiko
parent 2d97d4097f
commit a0334e97aa
3 changed files with 83 additions and 38 deletions

View File

@@ -293,5 +293,7 @@ LIBBPF_0.1.0 {
bpf_program__is_sk_lookup;
bpf_program__set_autoload;
bpf_program__set_sk_lookup;
btf__parse;
btf__parse_raw;
btf__set_fd;
} LIBBPF_0.0.9;