diff options
author | Andrii Nakryiko <andriin@fb.com> | 2019-12-13 17:43:32 -0800 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2019-12-15 15:58:05 -0800 |
commit | 01af3bf06755dc5cda7050fe5d898998e5775e63 (patch) | |
tree | fbfacf758d2ebf276a6ed08123ada06e8ae28f5e /tools/lib/bpf/libbpf.map | |
parent | 9f81654eebe8de7e0db15534816d8f6c84b2e1e5 (diff) | |
download | linux-01af3bf06755dc5cda7050fe5d898998e5775e63.tar.gz linux-01af3bf06755dc5cda7050fe5d898998e5775e63.tar.bz2 linux-01af3bf06755dc5cda7050fe5d898998e5775e63.zip |
libbpf: Expose BPF program's function name
Add APIs to get BPF program function name, as opposed to bpf_program__title(),
which returns BPF program function's section name. Function name has a benefit
of being a valid C identifier and uniquely identifies a specific BPF program,
while section name can be duplicated across multiple independent BPF programs.
Add also bpf_object__find_program_by_name(), similar to
bpf_object__find_program_by_title(), to facilitate looking up BPF programs by
their C function names.
Convert one of selftests to new API for look up.
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-9-andriin@fb.com
Diffstat (limited to 'tools/lib/bpf/libbpf.map')
-rw-r--r-- | tools/lib/bpf/libbpf.map | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/lib/bpf/libbpf.map b/tools/lib/bpf/libbpf.map index 990c7c0e2d9f..5a7630748eeb 100644 --- a/tools/lib/bpf/libbpf.map +++ b/tools/lib/bpf/libbpf.map @@ -212,6 +212,8 @@ LIBBPF_0.0.6 { LIBBPF_0.0.7 { global: btf_dump__emit_type_decl; + bpf_object__find_program_by_name; bpf_program__attach; + bpf_program__name; btf__align_of; } LIBBPF_0.0.6; |