mirror of
https://github.com/netdata/libbpf.git
synced 2026-11-09 04:10:13 +08:00
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 <jolsa@kernel.org> Link: https://lore.kernel.org/r/20230809083440.3209381-13-jolsa@kernel.org Signed-off-by: Alexei Starovoitov <ast@kernel.org>
This commit is contained in:
1 parent
91fd655644
commit
c7ef3a169e
3 files changed
+67
-1
No files matched your search
+1
-1
@@ -10569,7 +10569,7 @@ struct bpf_link *bpf_program__attach_ksyscall(const struct bpf_program *prog,
|
||||
}
|
||||
|
||||
/* Adapted from perf/util/string.c */
|
||||
static bool glob_match(const char *str, const char *pat)
|
||||
bool glob_match(const char *str, const char *pat)
|
||||
{
|
||||
while (*str && *pat && *pat != '*') {
|
||||
if (*pat == '?') { /* Matches any single character */
|
||||
|
||||
Reference in new issue
Block a user