Skip to content

Commit

Permalink
perf script: Fix unnecessary machine_resolve()
Browse files Browse the repository at this point in the history
machine_resolve() may have already been called. Test for that to avoid
calling it again unnecessarily.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Link: https //lore.kernel.org/r/20210811101036.17986-3-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
  • Loading branch information
Adrian Hunter authored and Arnaldo Carvalho de Melo committed Aug 11, 2021
1 parent 988db17 commit 2915972
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/perf/builtin-script.c
Original file line number Diff line number Diff line change
Expand Up @@ -2212,7 +2212,7 @@ static int process_sample_event(struct perf_tool *tool,
if (filter_cpu(sample))
goto out_put;

if (machine__resolve(machine, &al, sample) < 0) {
if (!al.thread && machine__resolve(machine, &al, sample) < 0) {
pr_err("problem processing %d event, skipping it.\n",
event->header.type);
ret = -1;
Expand Down

0 comments on commit 2915972

Please sign in to comment.