btf_loader: Use btf__parse_split()
This way we use libbtf to transparently load both ELF files with a BTF section as well as raw BTF files, such as those in /sys/kernel/btf/ or the ones generated using 'pahole --btf_encode_detached' Suggested-by: Andrii Nakryiko <andrii@kernel.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
parent
c9d4c106ab
commit
22a76fbc8b
6
libbtf.c
6
libbtf.c
|
@ -63,10 +63,8 @@ int btf_elf__load(struct btf_elf *btfe)
|
|||
|
||||
/* free initial empty BTF */
|
||||
btf__free(btfe->btf);
|
||||
if (btfe->raw_btf)
|
||||
btfe->btf = btf__parse_raw_split(btfe->filename, btfe->base_btf);
|
||||
else
|
||||
btfe->btf = btf__parse_elf_split(btfe->filename, btfe->base_btf);
|
||||
|
||||
btfe->btf = btf__parse_split(btfe->filename, btfe->base_btf);
|
||||
|
||||
err = libbpf_get_error(btfe->btf);
|
||||
if (err)
|
||||
|
|
Loading…
Reference in New Issue