aboutsummaryrefslogtreecommitdiffstats
path: root/tools/lib/bpf/libbpf.map
diff options
context:
space:
mode:
authorAndrii Nakryiko <andriin@fb.com>2019-12-13 17:43:32 -0800
committerAlexei Starovoitov <ast@kernel.org>2019-12-15 15:58:05 -0800
commit01af3bf06755dc5cda7050fe5d898998e5775e63 (patch)
treefbfacf758d2ebf276a6ed08123ada06e8ae28f5e /tools/lib/bpf/libbpf.map
parentlibbpf: Expose BTF-to-C type declaration emitting API (diff)
downloadlinux-dev-01af3bf06755dc5cda7050fe5d898998e5775e63.tar.xz
linux-dev-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 '')
-rw-r--r--tools/lib/bpf/libbpf.map2
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;