]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
perf metric: Don't remove scale from counts
authorIan Rogers <irogers@google.com>
Fri, 9 Feb 2024 20:49:47 +0000 (12:49 -0800)
committerSasha Levin <sashal@kernel.org>
Tue, 26 Mar 2024 22:19:48 +0000 (18:19 -0400)
commit0bbe598b583007527f63f71e90868b0ba3ed2b94
tree67504d1639bdc331fd289f0380e0cf9d3453c940
parent40ae9bb1ddc71d23d241bbd4af1252e3537b5ac2
perf metric: Don't remove scale from counts

[ Upstream commit 6d6be5eb45b423a37d746d3ee0fd0c78f76ead9f ]

Counts were switched from the scaled saved value form to the
aggregated count to avoid double accounting. When this happened the
removing of scaling for a count should have been removed, however, it
wasn't and this wasn't observed as it normally doesn't matter because
a counter's scale is 1. A problem was observed with RAPL events that
are scaled.

Fixes: 37cc8ad77cf8 ("perf metric: Directly use counts rather than saved_value")
Signed-off-by: Ian Rogers <irogers@google.com>
Reviewed-by: Kan Liang <kan.liang@linux.intel.com>
Cc: K Prateek Nayak <kprateek.nayak@amd.com>
Cc: James Clark <james.clark@arm.com>
Cc: Kaige Ye <ye@kaige.org>
Cc: John Garry <john.g.garry@oracle.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Link: https://lore.kernel.org/r/20240209204947.3873294-5-irogers@google.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/perf/util/stat-shadow.c