Skip to content

Commit d8a5b13

Browse files
ahunter6gregkh
authored andcommitted
perf script: Fix CPU filtering of a script's switch events
commit 5e0c325 upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 2386e81 commit d8a5b13

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
@@ -2354,7 +2354,7 @@ static int process_switch_event(struct perf_tool *tool,
23542354
if (perf_event__process_switch(tool, event, sample, machine) < 0)
23552355
return -1;
23562356

2357-
if (scripting_ops && scripting_ops->process_switch)
2357+
if (scripting_ops && scripting_ops->process_switch && !filter_cpu(sample))
23582358
scripting_ops->process_switch(event, sample, machine);
23592359

23602360
if (!script->show_switch_events)

0 commit comments

Comments
 (0)