File perf-script-Fix-CPU-filtering-of-a-script-s-switch-events.patch of Package perf
37
1
From: Adrian Hunter <adrian.hunter@intel.com>
2
Date: Wed, 15 Dec 2021 10:06:35 +0200
3
Subject: perf script: Fix CPU filtering of a script's switch events
4
Git-commit: 5e0c325cdb714409a5b242c9e73a1b61157abb36
5
Patch-mainline: v5.16-rc8
6
References: git-fixes
7
8
CPU filtering was not being applied to a script's switch events.
9
10
Fixes: 5bf83c29a0ad2e78 ("perf script: Add scripting operation process_switch()")
11
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
12
Acked-by: Namhyung Kim <namhyung@kernel.org>
13
Cc: Jiri Olsa <jolsa@redhat.com>
14
Cc: Riccardo Mancini <rickyman7@gmail.com>
15
Cc: stable@vger.kernel.org
16
Link: https://lore.kernel.org/r/20211215080636.149562-3-adrian.hunter@intel.com
17
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
18
Signed-off-by: Tony Jones <tonyj@suse.de>
19
---
20
tools/perf/builtin-script.c | 2 +-
21
1 file changed, 1 insertion(+), 1 deletion(-)
22
23
diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
24
index 9434367af166..c82b033e8942 100644
25
--- a/tools/perf/builtin-script.c
26
+++ b/tools/perf/builtin-script.c
27
28
if (perf_event__process_switch(tool, event, sample, machine) < 0)
29
return -1;
30
31
- if (scripting_ops && scripting_ops->process_switch)
32
+ if (scripting_ops && scripting_ops->process_switch && !filter_cpu(sample))
33
scripting_ops->process_switch(event, sample, machine);
34
35
if (!script->show_switch_events)
36
37