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

perf vendor events arm64: Add PE utilization metrics for neoverse-n2-v2

Add PE utilization related metrics. In cpu_utilization metric, if it is
neoverse-n2 which slots are 5, the real stall_slot need to subtract the
cpu_cycles according to the neoverse-n2 errata [0].

[0] https://documentation-service.arm.com/static/636a66a64e6cf12278ad89cb?token=

Reviewed-by: John Garry <john.g.garry@oracle.com>
Signed-off-by: Jing Zhang <renyu.zj@linux.alibaba.com>
Acked-by: Ian Rogers <irogers@google.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andrew Kilroy <andrew.kilroy@arm.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: James Clark <james.clark@arm.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Leo Yan <leo.yan@linaro.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Mike Leach <mike.leach@linaro.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Shuai Xue <xueshuai@linux.alibaba.com>
Cc: Will Deacon <will@kernel.org>
Cc: Xing Zhengjun <zhengjun.xing@linux.intel.com>
Cc: Zhuo Song <zhuo.song@linux.alibaba.com>
Cc: linux-arm-kernel@lists.infradead.org
Link: https://lore.kernel.org/r/1673940573-90503-9-git-send-email-renyu.zj@linux.alibaba.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Jing Zhang and committed by
Arnaldo Carvalho de Melo
4befa5cf a1adade7

+46
+46
tools/perf/pmu-events/arch/arm64/arm/neoverse-n2-v2/metrics.json
··· 160 160 "MetricGroup": "Branch", 161 161 "MetricName": "branch_miss_pred_rate", 162 162 "ScaleUnit": "100%" 163 + }, 164 + { 165 + "MetricExpr": "instructions / CPU_CYCLES", 166 + "BriefDescription": "The average number of instructions executed for each cycle.", 167 + "MetricGroup": "PEutilization", 168 + "MetricName": "ipc" 169 + }, 170 + { 171 + "MetricExpr": "ipc / 5", 172 + "BriefDescription": "IPC percentage of peak. The peak of IPC is 5.", 173 + "MetricGroup": "PEutilization", 174 + "MetricName": "ipc_rate", 175 + "ScaleUnit": "100%" 176 + }, 177 + { 178 + "MetricExpr": "INST_RETIRED / CPU_CYCLES", 179 + "BriefDescription": "Architecturally executed Instructions Per Cycle (IPC)", 180 + "MetricGroup": "PEutilization", 181 + "MetricName": "retired_ipc" 182 + }, 183 + { 184 + "MetricExpr": "INST_SPEC / CPU_CYCLES", 185 + "BriefDescription": "Speculatively executed Instructions Per Cycle (IPC)", 186 + "MetricGroup": "PEutilization", 187 + "MetricName": "spec_ipc" 188 + }, 189 + { 190 + "MetricExpr": "OP_RETIRED / OP_SPEC", 191 + "BriefDescription": "Of all the micro-operations issued, what percentage are retired(committed)", 192 + "MetricGroup": "PEutilization", 193 + "MetricName": "retired_rate", 194 + "ScaleUnit": "100%" 195 + }, 196 + { 197 + "MetricExpr": "1 - OP_RETIRED / OP_SPEC", 198 + "BriefDescription": "Of all the micro-operations issued, what percentage are not retired(committed)", 199 + "MetricGroup": "PEutilization", 200 + "MetricName": "wasted_rate", 201 + "ScaleUnit": "100%" 202 + }, 203 + { 204 + "MetricExpr": "OP_RETIRED / OP_SPEC * (1 - (STALL_SLOT if (#slots - 5) else (STALL_SLOT - CPU_CYCLES)) / (#slots * CPU_CYCLES))", 205 + "BriefDescription": "The truly effective ratio of micro-operations executed by the CPU, which means that misprediction and stall are not included", 206 + "MetricGroup": "PEutilization", 207 + "MetricName": "cpu_utilization", 208 + "ScaleUnit": "100%" 163 209 } 164 210 ]