OSDN Git Service

libbpf: Add internal helper to load BTF data by FD
authorAndrii Nakryiko <andrii@kernel.org>
Thu, 3 Dec 2020 20:46:23 +0000 (12:46 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 4 Dec 2020 01:38:20 +0000 (17:38 -0800)
commita19f93cfafdf85851c69bc9f677aa4f40c53610f
tree08c46ad0d0f0a2f5ec14b0257d475edc6f719d6c
parent2fe8890848c799515a881502339a0a7b2b555988
libbpf: Add internal helper to load BTF data by FD

Add a btf_get_from_fd() helper, which constructs struct btf from in-kernel BTF
data by FD. This is used for loading module BTFs.

Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20201203204634.1325171-4-andrii@kernel.org
tools/lib/bpf/btf.c
tools/lib/bpf/libbpf_internal.h