lkml.org 
[lkml]   [2022]   [Sep]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 2/6] perf stat: Don't call perf_stat_evsel_id_init() repeatedly
From


On 26/09/2022 21:07, Namhyung Kim wrote:
> The evsel__reset_stat_priv() is called more than once if user gave -r
> option for multiple run. But it doesn't need to re-initialize the id.
>
> Signed-off-by: Namhyung Kim <namhyung@kernel.org>
> ---
> tools/perf/util/stat.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>

Reviewed-by: James Clark <james.clark@arm.com>

> diff --git a/tools/perf/util/stat.c b/tools/perf/util/stat.c
> index 6bcd3dc32a71..e1d3152ce664 100644
> --- a/tools/perf/util/stat.c
> +++ b/tools/perf/util/stat.c
> @@ -135,7 +135,6 @@ static void evsel__reset_stat_priv(struct evsel *evsel)
> struct perf_stat_evsel *ps = evsel->stats;
>
> init_stats(&ps->res_stats);
> - perf_stat_evsel_id_init(evsel);
> }
>
> static int evsel__alloc_stat_priv(struct evsel *evsel)
> @@ -143,6 +142,7 @@ static int evsel__alloc_stat_priv(struct evsel *evsel)
> evsel->stats = zalloc(sizeof(struct perf_stat_evsel));
> if (evsel->stats == NULL)
> return -ENOMEM;
> + perf_stat_evsel_id_init(evsel);
> evsel__reset_stat_priv(evsel);
> return 0;
> }

\
 
 \ /
  Last update: 2022-09-28 12:42    [W:1.023 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site