Skip to content

Commit 5e0c325

Browse files
ahunter6acmel
authored andcommitted
perf script: Fix CPU filtering of a script's switch events
CPU filtering was not being applied to a script's switch events. Fixes: 5bf83c2 ("perf script: Add scripting operation process_switch()") Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Acked-by: Namhyung Kim <namhyung@kernel.org> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Riccardo Mancini <rickyman7@gmail.com> Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20211215080636.149562-3-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
1 parent a78abde commit 5e0c325

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

tools/perf/builtin-script.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2473,7 +2473,7 @@ static int process_switch_event(struct perf_tool *tool,
24732473
if (perf_event__process_switch(tool, event, sample, machine) < 0)
24742474
return -1;
24752475

2476-
if (scripting_ops && scripting_ops->process_switch)
2476+
if (scripting_ops && scripting_ops->process_switch && !filter_cpu(sample))
24772477
scripting_ops->process_switch(event, sample, machine);
24782478

24792479
if (!script->show_switch_events)

0 commit comments

Comments
 (0)