aboutsummaryrefslogtreecommitdiffstats
path: root/tools/lib/bpf/libbpf_internal.h
diff options
context:
space:
mode:
authorJiri Olsa <[email protected]>2023-08-09 08:34:24 +0000
committerAlexei Starovoitov <[email protected]>2023-08-21 22:51:26 +0000
commite613d1d0f7d4f6ee9b458c62f85c577872dce9a6 (patch)
treea21abb94cf79c2bcd054142ddce89773e2d4c899 /tools/lib/bpf/libbpf_internal.h
parentlibbpf: Add elf_resolve_syms_offsets function (diff)
downloadkernel-e613d1d0f7d4f6ee9b458c62f85c577872dce9a6.tar.gz
kernel-e613d1d0f7d4f6ee9b458c62f85c577872dce9a6.zip
libbpf: Add elf_resolve_pattern_offsets function
Adding elf_resolve_pattern_offsets function that looks up offsets for symbols specified by pattern argument. The 'pattern' argument allows wildcards (*?' supported). Offsets are returned in allocated array together with its size and needs to be released by the caller. Signed-off-by: Jiri Olsa <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexei Starovoitov <[email protected]>
Diffstat (limited to 'tools/lib/bpf/libbpf_internal.h')
-rw-r--r--tools/lib/bpf/libbpf_internal.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/lib/bpf/libbpf_internal.h b/tools/lib/bpf/libbpf_internal.h
index 92851c5f912d..ead551318fec 100644
--- a/tools/lib/bpf/libbpf_internal.h
+++ b/tools/lib/bpf/libbpf_internal.h
@@ -578,6 +578,8 @@ static inline bool is_pow_of_2(size_t x)
#define PROG_LOAD_ATTEMPTS 5
int sys_bpf_prog_load(union bpf_attr *attr, unsigned int size, int attempts);
+bool glob_match(const char *str, const char *pat);
+
long elf_find_func_offset(Elf *elf, const char *binary_path, const char *name);
long elf_find_func_offset_from_file(const char *binary_path, const char *name);
@@ -591,4 +593,7 @@ void elf_close(struct elf_fd *elf_fd);
int elf_resolve_syms_offsets(const char *binary_path, int cnt,
const char **syms, unsigned long **poffsets);
+int elf_resolve_pattern_offsets(const char *binary_path, const char *pattern,
+ unsigned long **poffsets, size_t *pcnt);
+
#endif /* __LIBBPF_LIBBPF_INTERNAL_H */