]> git.baikalelectronics.ru Git - kernel.git/commit
libbpf: Postpone BTF ID finding for TRACING programs to load phase
authorAndrii Nakryiko <andriin@fb.com>
Sat, 14 Dec 2019 01:43:34 +0000 (17:43 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Sun, 15 Dec 2019 23:58:05 +0000 (15:58 -0800)
commitce839b6843dd2b707d77e9959f7937e937902c40
treeb5d2652e558a09630556f350f706a714088e98c7
parentfd57ffe4cf592671f62b76fa820d216d957a30cc
libbpf: Postpone BTF ID finding for TRACING programs to load phase

Move BTF ID determination for BPF_PROG_TYPE_TRACING programs to a load phase.
Performing it at open step is inconvenient, because it prevents BPF skeleton
generation on older host kernel, which doesn't contain BTF_KIND_FUNCs
information in vmlinux BTF. This is a common set up, though, when, e.g.,
selftests are compiled on older host kernel, but the test program itself is
executed in qemu VM with bleeding edge kernel. Having this BTF searching
performed at load time allows to successfully use bpf_object__open() for
codegen and inspection of BPF object file.

Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Link: https://lore.kernel.org/bpf/20191214014341.3442258-11-andriin@fb.com
tools/lib/bpf/libbpf.c