From: James Clark <james.clark@linaro.org>
To: Yangyu Chen <cyy@cyyself.name>,
linux-perf-users@vger.kernel.org, irogers@google.com,
namhyung@kernel.org
Cc: acme@kernel.org, adrian.hunter@intel.com,
alexander.shishkin@linux.intel.com, fj3333bs@aa.jp.fujitsu.com,
fj5100bi@fujitsu.com, john.g.garry@oracle.com, jolsa@kernel.org,
kan.liang@linux.intel.com, leo.yan@linux.dev,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, mark.rutland@arm.com,
mike.leach@linaro.org, mingo@redhat.com, peterz@infradead.org,
will@kernel.org
Subject: Re: [PATCH] perf vendor events arm64: Fix incorrect CPU_CYCLE in metrics expr
Date: Thu, 13 Feb 2025 10:52:07 +0000 [thread overview]
Message-ID: <5f4e90f2-1956-4f12-b2f4-b355012beb6e@linaro.org> (raw)
In-Reply-To: <tencent_D4ED18476ADCE818E31084C60E3E72C14907@qq.com>
On 13/02/2025 8:44 am, Yangyu Chen wrote:
> Some existing metrics for Neoverse N3 and V3 expressions use CPU_CYCLE
> to represent the number of cycles, but this is incorrect. The correct
> event to use is CPU_CYCLES.
>
> I encountered this issue while working on a patch to add pmu events for
> Cortex A720 and A520 by reusing the existing patch for Neoverse N3 and
> V3 by James Clark [1] and my check script [2] reported this issue.
>
> [1] https://lore.kernel.org/lkml/20250122163504.2061472-1-james.clark@linaro.org/
> [2] https://github.com/cyyself/arm-pmu-check
>
> Signed-off-by: Yangyu Chen <cyy@cyyself.name>
Thanks for the fix. I'll report this issue on the source data.
Reviewed-by: James Clark <james.clark@linaro.org>
> ---
> .../perf/pmu-events/arch/arm64/arm/neoverse-n3/metrics.json | 6 +++---
> .../perf/pmu-events/arch/arm64/arm/neoverse-v3/metrics.json | 6 +++---
> 2 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/tools/perf/pmu-events/arch/arm64/arm/neoverse-n3/metrics.json b/tools/perf/pmu-events/arch/arm64/arm/neoverse-n3/metrics.json
> index 1f7c9536cb88..eb3a35f244e7 100644
> --- a/tools/perf/pmu-events/arch/arm64/arm/neoverse-n3/metrics.json
> +++ b/tools/perf/pmu-events/arch/arm64/arm/neoverse-n3/metrics.json
> @@ -169,7 +169,7 @@
> },
> {
> "MetricName": "fp_ops_per_cycle",
> - "MetricExpr": "(FP_SCALE_OPS_SPEC + FP_FIXED_OPS_SPEC) / CPU_CYCLE",
> + "MetricExpr": "(FP_SCALE_OPS_SPEC + FP_FIXED_OPS_SPEC) / CPU_CYCLES",
> "BriefDescription": "This metric measures floating point operations per cycle in any precision performed by any instruction. Operations are counted by computation and by vector lanes, fused computations such as multiply-add count as twice per vector lane for example.",
> "MetricGroup": "FP_Arithmetic_Intensity",
> "ScaleUnit": "1operations per cycle"
> @@ -383,7 +383,7 @@
> },
> {
> "MetricName": "nonsve_fp_ops_per_cycle",
> - "MetricExpr": "FP_FIXED_OPS_SPEC / CPU_CYCLE",
> + "MetricExpr": "FP_FIXED_OPS_SPEC / CPU_CYCLES",
> "BriefDescription": "This metric measures floating point operations per cycle in any precision performed by an instruction that is not an SVE instruction. Operations are counted by computation and by vector lanes, fused computations such as multiply-add count as twice per vector lane for example.",
> "MetricGroup": "FP_Arithmetic_Intensity",
> "ScaleUnit": "1operations per cycle"
> @@ -421,7 +421,7 @@
> },
> {
> "MetricName": "sve_fp_ops_per_cycle",
> - "MetricExpr": "FP_SCALE_OPS_SPEC / CPU_CYCLE",
> + "MetricExpr": "FP_SCALE_OPS_SPEC / CPU_CYCLES",
> "BriefDescription": "This metric measures floating point operations per cycle in any precision performed by SVE instructions. Operations are counted by computation and by vector lanes, fused computations such as multiply-add count as twice per vector lane for example.",
> "MetricGroup": "FP_Arithmetic_Intensity",
> "ScaleUnit": "1operations per cycle"
> diff --git a/tools/perf/pmu-events/arch/arm64/arm/neoverse-v3/metrics.json b/tools/perf/pmu-events/arch/arm64/arm/neoverse-v3/metrics.json
> index d022ae25c864..4a671f55eaf3 100644
> --- a/tools/perf/pmu-events/arch/arm64/arm/neoverse-v3/metrics.json
> +++ b/tools/perf/pmu-events/arch/arm64/arm/neoverse-v3/metrics.json
> @@ -169,7 +169,7 @@
> },
> {
> "MetricName": "fp_ops_per_cycle",
> - "MetricExpr": "(FP_SCALE_OPS_SPEC + FP_FIXED_OPS_SPEC) / CPU_CYCLE",
> + "MetricExpr": "(FP_SCALE_OPS_SPEC + FP_FIXED_OPS_SPEC) / CPU_CYCLES",
> "BriefDescription": "This metric measures floating point operations per cycle in any precision performed by any instruction. Operations are counted by computation and by vector lanes, fused computations such as multiply-add count as twice per vector lane for example.",
> "MetricGroup": "FP_Arithmetic_Intensity",
> "ScaleUnit": "1operations per cycle"
> @@ -383,7 +383,7 @@
> },
> {
> "MetricName": "nonsve_fp_ops_per_cycle",
> - "MetricExpr": "FP_FIXED_OPS_SPEC / CPU_CYCLE",
> + "MetricExpr": "FP_FIXED_OPS_SPEC / CPU_CYCLES",
> "BriefDescription": "This metric measures floating point operations per cycle in any precision performed by an instruction that is not an SVE instruction. Operations are counted by computation and by vector lanes, fused computations such as multiply-add count as twice per vector lane for example.",
> "MetricGroup": "FP_Arithmetic_Intensity",
> "ScaleUnit": "1operations per cycle"
> @@ -421,7 +421,7 @@
> },
> {
> "MetricName": "sve_fp_ops_per_cycle",
> - "MetricExpr": "FP_SCALE_OPS_SPEC / CPU_CYCLE",
> + "MetricExpr": "FP_SCALE_OPS_SPEC / CPU_CYCLES",
> "BriefDescription": "This metric measures floating point operations per cycle in any precision performed by SVE instructions. Operations are counted by computation and by vector lanes, fused computations such as multiply-add count as twice per vector lane for example.",
> "MetricGroup": "FP_Arithmetic_Intensity",
> "ScaleUnit": "1operations per cycle"
next prev parent reply other threads:[~2025-02-13 10:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-13 8:44 Yangyu Chen
2025-02-13 10:52 ` James Clark [this message]
2025-02-20 18:26 ` Namhyung Kim
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5f4e90f2-1956-4f12-b2f4-b355012beb6e@linaro.org \
--to=james.clark@linaro.org \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=cyy@cyyself.name \
--cc=fj3333bs@aa.jp.fujitsu.com \
--cc=fj5100bi@fujitsu.com \
--cc=irogers@google.com \
--cc=john.g.garry@oracle.com \
--cc=jolsa@kernel.org \
--cc=kan.liang@linux.intel.com \
--cc=leo.yan@linux.dev \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mike.leach@linaro.org \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®