OSDN Git Service

libbpf: Deprecate notion of BPF program "title" in favor of "section name"
authorAndrii Nakryiko <andriin@fb.com>
Thu, 3 Sep 2020 20:35:38 +0000 (13:35 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 4 Sep 2020 00:14:40 +0000 (17:14 -0700)
commit52109584202783e90a83c95103307a9a03ba7d9e
tree8dbef07432ad8d406f8037efd5c374941c79085f
parenta7659cc30bc9210d885692d175f4bc6f3a9a2175
libbpf: Deprecate notion of BPF program "title" in favor of "section name"

BPF program title is ambigious and misleading term. It is ELF section name, so
let's just call it that and deprecate bpf_program__title() API in favor of
bpf_program__section_name().

Additionally, using bpf_object__find_program_by_title() is now inherently
dangerous and ambiguous, as multiple BPF program can have the same section
name. So deprecate this API as well and recommend to switch to non-ambiguous
bpf_object__find_program_by_name().

Internally, clean up usage and mis-usage of BPF program section name for
denoting BPF program name. Shorten the field name to prog->sec_name to be
consistent with all other prog->sec_* variables.

Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20200903203542.15944-11-andriin@fb.com
tools/lib/bpf/libbpf.c
tools/lib/bpf/libbpf.h
tools/lib/bpf/libbpf.map