OSDN Git Service

libbpf: Simplify BPF program auto-attach code
authorAndrii Nakryiko <andrii@kernel.org>
Tue, 14 Sep 2021 01:47:32 +0000 (18:47 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 14 Sep 2021 22:49:24 +0000 (15:49 -0700)
commit5532dfd42e4846e84d346a6dfe01e477e35baa65
tree81f401da9d5eab5a1a06afc81189938aaab4c61f
parent91b4d1d1d54431c72f3a7ff034f30a635f787426
libbpf: Simplify BPF program auto-attach code

Remove the need to explicitly pass bpf_sec_def for auto-attachable BPF
programs, as it is already recorded at bpf_object__open() time for all
recognized type of BPF programs. This further reduces number of explicit
calls to find_sec_def(), simplifying further refactorings.

No functional changes are done by this patch.

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