Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

perf vendor events arm64: Fix incorrect CPU_CYCLE in metrics expr

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>
Reviewed-by: James Clark <james.clark@linaro.org>
Link: https://lore.kernel.org/r/tencent_D4ED18476ADCE818E31084C60E3E72C14907@qq.com
Signed-off-by: Namhyung Kim <namhyung@kernel.org>

authored by

Yangyu Chen and committed by
Namhyung Kim
2ed0e3ea 29bab854

+6 -6
+3 -3
tools/perf/pmu-events/arch/arm64/arm/neoverse-n3/metrics.json
··· 169 169 }, 170 170 { 171 171 "MetricName": "fp_ops_per_cycle", 172 - "MetricExpr": "(FP_SCALE_OPS_SPEC + FP_FIXED_OPS_SPEC) / CPU_CYCLE", 172 + "MetricExpr": "(FP_SCALE_OPS_SPEC + FP_FIXED_OPS_SPEC) / CPU_CYCLES", 173 173 "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.", 174 174 "MetricGroup": "FP_Arithmetic_Intensity", 175 175 "ScaleUnit": "1operations per cycle" ··· 383 383 }, 384 384 { 385 385 "MetricName": "nonsve_fp_ops_per_cycle", 386 - "MetricExpr": "FP_FIXED_OPS_SPEC / CPU_CYCLE", 386 + "MetricExpr": "FP_FIXED_OPS_SPEC / CPU_CYCLES", 387 387 "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.", 388 388 "MetricGroup": "FP_Arithmetic_Intensity", 389 389 "ScaleUnit": "1operations per cycle" ··· 421 421 }, 422 422 { 423 423 "MetricName": "sve_fp_ops_per_cycle", 424 - "MetricExpr": "FP_SCALE_OPS_SPEC / CPU_CYCLE", 424 + "MetricExpr": "FP_SCALE_OPS_SPEC / CPU_CYCLES", 425 425 "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.", 426 426 "MetricGroup": "FP_Arithmetic_Intensity", 427 427 "ScaleUnit": "1operations per cycle"
+3 -3
tools/perf/pmu-events/arch/arm64/arm/neoverse-v3/metrics.json
··· 169 169 }, 170 170 { 171 171 "MetricName": "fp_ops_per_cycle", 172 - "MetricExpr": "(FP_SCALE_OPS_SPEC + FP_FIXED_OPS_SPEC) / CPU_CYCLE", 172 + "MetricExpr": "(FP_SCALE_OPS_SPEC + FP_FIXED_OPS_SPEC) / CPU_CYCLES", 173 173 "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.", 174 174 "MetricGroup": "FP_Arithmetic_Intensity", 175 175 "ScaleUnit": "1operations per cycle" ··· 383 383 }, 384 384 { 385 385 "MetricName": "nonsve_fp_ops_per_cycle", 386 - "MetricExpr": "FP_FIXED_OPS_SPEC / CPU_CYCLE", 386 + "MetricExpr": "FP_FIXED_OPS_SPEC / CPU_CYCLES", 387 387 "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.", 388 388 "MetricGroup": "FP_Arithmetic_Intensity", 389 389 "ScaleUnit": "1operations per cycle" ··· 421 421 }, 422 422 { 423 423 "MetricName": "sve_fp_ops_per_cycle", 424 - "MetricExpr": "FP_SCALE_OPS_SPEC / CPU_CYCLE", 424 + "MetricExpr": "FP_SCALE_OPS_SPEC / CPU_CYCLES", 425 425 "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.", 426 426 "MetricGroup": "FP_Arithmetic_Intensity", 427 427 "ScaleUnit": "1operations per cycle"