]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
perf tool_pmu: Use old_count when computing count values for time events
authorIan Rogers <irogers@google.com>
Thu, 13 Nov 2025 18:05:09 +0000 (10:05 -0800)
committerNamhyung Kim <namhyung@kernel.org>
Tue, 18 Nov 2025 02:43:08 +0000 (18:43 -0800)
commitbdf96c4ecd69523d97c98e47284caddde20b1df7
tree07a02521e0bed6a71bbb56f78818ee03be53607c
parentf69d34e8f23db8bca38c82a04ee9cd990777aaa2
perf tool_pmu: Use old_count when computing count values for time events

When running in interval mode every third count of a time event isn't
showing properly:
```
$ perf stat -e duration_time -a -I 1000
     1.001082862      1,002,290,425      duration_time
     2.004264262      1,003,183,516      duration_time
     3.007381401      <not counted>      duration_time
     4.011160141      1,003,705,631      duration_time
     5.014515385      1,003,290,110      duration_time
     6.018539680      <not counted>      duration_time
     7.022065321      1,003,591,720      duration_time
```
The regression came in with a different fix, found through bisection,
commit 68cb1567439f ("perf tool_pmu: Fix aggregation on
duration_time"). The issue is caused by the enabled and running time
of the event matching the old_count's and creating a delta of 0, which
is indicative of an error.

Fixes: 68cb1567439f ("perf tool_pmu: Fix aggregation on duration_time")
Signed-off-by: Ian Rogers <irogers@google.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
tools/perf/builtin-stat.c
tools/perf/util/tool_pmu.c