lkml.org 
[lkml]   [2021]   [Dec]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 2/3] perf script: Fix CPU filtering of a script's switch events
On Wed, Dec 15, 2021 at 12:07 AM Adrian Hunter <adrian.hunter@intel.com> wrote:
>
> CPU filtering was not being applied to a script's switch events.
>
> Fixes: 5bf83c29a0ad2 ("perf script: Add scripting operation process_switch()")
> Cc: stable@vger.kernel.org
> Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>

Acked-by: Namhyung Kim <namhyung@kernel.org>

Thanks,
Namhyung

> ---
> tools/perf/builtin-script.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
> index 9434367af166..c82b033e8942 100644
> --- a/tools/perf/builtin-script.c
> +++ b/tools/perf/builtin-script.c
> @@ -2473,7 +2473,7 @@ static int process_switch_event(struct perf_tool *tool,
> if (perf_event__process_switch(tool, event, sample, machine) < 0)
> return -1;
>
> - if (scripting_ops && scripting_ops->process_switch)
> + if (scripting_ops && scripting_ops->process_switch && !filter_cpu(sample))
> scripting_ops->process_switch(event, sample, machine);
>
> if (!script->show_switch_events)
> --
> 2.25.1
>

\
 
 \ /
  Last update: 2021-12-15 19:06    [W:0.048 / U:0.792 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site