mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-19 14:56:21 +00:00
perf trace: Look up maps just on the __augmented_syscalls__ BPF object
We can conceivably have multiple BPF object files for other purposes, so better look just on the BPF object containing the __augmented_syscalls__ map for all things augmented_syscalls related. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Brendan Gregg <brendan.d.gregg@gmail.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Luis Cláudio Gonçalves <lclaudio@redhat.com> Cc: Namhyung Kim <namhyung@kernel.org> Link: https://lkml.kernel.org/n/tip-3jt8knkuae9lt705r1lns202@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
parent
c8c805707e
commit
5ca0b7f500
@ -3669,28 +3669,22 @@ static int trace__parse_cgroups(const struct option *opt, const char *str, int u
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct bpf_map *bpf__find_map_by_name(const char *name)
|
||||
static struct bpf_map *trace__find_bpf_map_by_name(struct trace *trace, const char *name)
|
||||
{
|
||||
struct bpf_object *obj, *tmp;
|
||||
if (trace->bpf_obj == NULL)
|
||||
return NULL;
|
||||
|
||||
bpf_object__for_each_safe(obj, tmp) {
|
||||
struct bpf_map *map = bpf_object__find_map_by_name(obj, name);
|
||||
if (map)
|
||||
return map;
|
||||
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return bpf_object__find_map_by_name(trace->bpf_obj, name);
|
||||
}
|
||||
|
||||
static void trace__set_bpf_map_filtered_pids(struct trace *trace)
|
||||
{
|
||||
trace->filter_pids.map = bpf__find_map_by_name("pids_filtered");
|
||||
trace->filter_pids.map = trace__find_bpf_map_by_name(trace, "pids_filtered");
|
||||
}
|
||||
|
||||
static void trace__set_bpf_map_syscalls(struct trace *trace)
|
||||
{
|
||||
trace->syscalls.map = bpf__find_map_by_name("syscalls");
|
||||
trace->syscalls.map = trace__find_bpf_map_by_name(trace, "syscalls");
|
||||
}
|
||||
|
||||
static int trace__config(const char *var, const char *value, void *arg)
|
||||
@ -3924,7 +3918,7 @@ int cmd_trace(int argc, const char **argv)
|
||||
err = -1;
|
||||
|
||||
if (map_dump_str) {
|
||||
trace.dump.map = bpf__find_map_by_name(map_dump_str);
|
||||
trace.dump.map = trace__find_bpf_map_by_name(&trace, map_dump_str);
|
||||
if (trace.dump.map == NULL) {
|
||||
pr_err("ERROR: BPF map \"%s\" not found\n", map_dump_str);
|
||||
goto out;
|
||||
|
Loading…
x
Reference in New Issue
Block a user