Re: [PATCH v1] perf tool_pmu: Fix aggregation on duration_time

From: Arnaldo Carvalho de Melo
Date: Thu Apr 24 2025 - 08:58:40 EST


On Wed, Apr 23, 2025 at 09:58:38AM +0100, James Clark wrote:
> > +++ b/tools/perf/util/tool_pmu.c
> > @@ -486,8 +486,14 @@ int evsel__tool_pmu_read(struct evsel *evsel, int cpu_map_idx, int thread)
> > delta_start *= 1000000000 / ticks_per_sec;
> > }
> > count->val = delta_start;
> > - count->ena = count->run = delta_start;
> > count->lost = 0;
> > + /*
> > + * The values of enabled and running must make a ratio of 100%. The
> > + * exact values don't matter as long as they are non-zero to avoid
> > + * issues with evsel__count_has_error.
> > + */
> > + count->ena++;
> > + count->run++;
> > return 0;
> > }

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

Thanks, applied to perf-tools-next,

- Arnaldo