[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <880bebc4-5a59-451e-beb2-60cee9a3efd5@linaro.org>
Date: Tue, 18 Mar 2025 10:47:02 +0000
From: James Clark <james.clark@...aro.org>
To: Ilkka Koskinen <ilkka@...amperecomputing.com>
Cc: linux-arm-kernel@...ts.infradead.org, linux-perf-users@...r.kernel.org,
linux-kernel@...r.kernel.org, Namhyung Kim <namhyung@...nel.org>,
Arnaldo Carvalho de Melo <acme@...nel.org>, Ian Rogers <irogers@...gle.com>,
John Garry <john.g.garry@...cle.com>, Will Deacon <will@...nel.org>,
Mike Leach <mike.leach@...aro.org>, Leo Yan <leo.yan@...ux.dev>,
Peter Zijlstra <peterz@...radead.org>, Ingo Molnar <mingo@...hat.com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Jiri Olsa <jolsa@...nel.org>, Adrian Hunter <adrian.hunter@...el.com>,
"Liang, Kan" <kan.liang@...ux.intel.com>, Mark Rutland <mark.rutland@....com>
Subject: Re: [PATCH 2/2] perf vendor events arm64 AmpereOneX: Fix
frontend_bound calculation
On 13/03/2025 8:15 pm, Ilkka Koskinen wrote:
> frontend_bound metrics was miscalculated due to different scaling in
> a couple of metrics it depends on. Change the scaling to match with
> AmpereOne.
>
> Fixes: 16438b652b46 ("perf vendor events arm64 AmpereOneX: Add core PMU events and metrics")
> Signed-off-by: Ilkka Koskinen <ilkka@...amperecomputing.com>
> ---
> .../arch/arm64/ampere/ampereonex/metrics.json | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/tools/perf/pmu-events/arch/arm64/ampere/ampereonex/metrics.json b/tools/perf/pmu-events/arch/arm64/ampere/ampereonex/metrics.json
> index c5d1d22bd034..5228f94a793f 100644
> --- a/tools/perf/pmu-events/arch/arm64/ampere/ampereonex/metrics.json
> +++ b/tools/perf/pmu-events/arch/arm64/ampere/ampereonex/metrics.json
> @@ -229,19 +229,19 @@
> },
> {
> "MetricName": "slots_lost_misspeculation_fraction",
> - "MetricExpr": "(OP_SPEC - OP_RETIRED) / (CPU_CYCLES * #slots)",
> + "MetricExpr": "100 * (OP_SPEC - OP_RETIRED) / (CPU_CYCLES * #slots)",
> "BriefDescription": "Fraction of slots lost due to misspeculation",
> "DefaultMetricgroupName": "TopdownL1",
> "MetricGroup": "Default;TopdownL1",
> - "ScaleUnit": "100percent of slots"
> + "ScaleUnit": "1percent of slots"
> },
> {
> "MetricName": "retired_fraction",
> - "MetricExpr": "OP_RETIRED / (CPU_CYCLES * #slots)",
> + "MetricExpr": "100 * OP_RETIRED / (CPU_CYCLES * #slots)",
> "BriefDescription": "Fraction of slots retiring, useful work",
> "DefaultMetricgroupName": "TopdownL1",
> "MetricGroup": "Default;TopdownL1",
> - "ScaleUnit": "100percent of slots"
> + "ScaleUnit": "1percent of slots"
I never considered that ScaleUnit could be an issue when the metric was
included in other metrics with different scales. Seems like an easy trap.
Reviewed-by: James Clark <james.clark@...aro.org>
Powered by blists - more mailing lists