Skip to content

Commit a9fe4ac

Browse files
sandip4nacmel
authored andcommitted
perf vendor events amd: Add Zen 5 metrics
Add metrics taken from Section 1.2 "Performance Measurement" of the Performance Monitor Counters for AMD Family 1Ah Model 00h-0Fh Processors document available at the link below. The recommended metrics are sourced from Table 1 "Guidance for Common Performance Statistics with Complex Event Selects". The pipeline utilization metrics are sourced from Table 2 "Guidance for Pipeline Utilization Analysis Statistics". These are useful for finding performance bottlenecks by analyzing activity at different stages of the pipeline. There are metric groups available for Level 1 and Level 2 analysis. Reviewed-by: Ian Rogers <irogers@google.com> Signed-off-by: Sandipan Das <sandipan.das@amd.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Ananth Narayan <ananth.narayan@amd.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Ravi Bangoria <ravi.bangoria@amd.com> Cc: Stephane Eranian <eranian@google.com> Link: https://bugzilla.kernel.org/attachment.cgi?id=305974 Link: https://lore.kernel.org/r/ee21ff77d89efa99997d3c2ebeeae22ddb6e7e12.1714717230.git.sandipan.das@amd.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
1 parent dc082ae commit a9fe4ac

2 files changed

Lines changed: 444 additions & 0 deletions

File tree

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
[
2+
{
3+
"MetricName": "total_dispatch_slots",
4+
"BriefDescription": "Total dispatch slots (up to 8 instructions can be dispatched in each cycle).",
5+
"MetricExpr": "8 * ls_not_halted_cyc",
6+
"ScaleUnit": "1slots"
7+
},
8+
{
9+
"MetricName": "frontend_bound",
10+
"BriefDescription": "Percentage of dispatch slots that remained unused because the frontend did not supply enough instructions/ops.",
11+
"MetricExpr": "d_ratio(de_no_dispatch_per_slot.no_ops_from_frontend, total_dispatch_slots)",
12+
"MetricGroup": "PipelineL1",
13+
"ScaleUnit": "100%slots"
14+
},
15+
{
16+
"MetricName": "bad_speculation",
17+
"BriefDescription": "Percentage of dispatched ops that did not retire.",
18+
"MetricExpr": "d_ratio(de_src_op_disp.all - ex_ret_ops, total_dispatch_slots)",
19+
"MetricGroup": "PipelineL1",
20+
"ScaleUnit": "100%ops"
21+
},
22+
{
23+
"MetricName": "backend_bound",
24+
"BriefDescription": "Percentage of dispatch slots that remained unused because of backend stalls.",
25+
"MetricExpr": "d_ratio(de_no_dispatch_per_slot.backend_stalls, total_dispatch_slots)",
26+
"MetricGroup": "PipelineL1",
27+
"ScaleUnit": "100%slots"
28+
},
29+
{
30+
"MetricName": "smt_contention",
31+
"BriefDescription": "Percentage of dispatch slots that remained unused because the other thread was selected.",
32+
"MetricExpr": "d_ratio(de_no_dispatch_per_slot.smt_contention, total_dispatch_slots)",
33+
"MetricGroup": "PipelineL1",
34+
"ScaleUnit": "100%slots"
35+
},
36+
{
37+
"MetricName": "retiring",
38+
"BriefDescription": "Percentage of dispatch slots used by ops that retired.",
39+
"MetricExpr": "d_ratio(ex_ret_ops, total_dispatch_slots)",
40+
"MetricGroup": "PipelineL1",
41+
"ScaleUnit": "100%slots"
42+
},
43+
{
44+
"MetricName": "frontend_bound_by_latency",
45+
"BriefDescription": "Percentage of dispatch slots that remained unused because of a latency bottleneck in the frontend (such as instruction cache or TLB misses).",
46+
"MetricExpr": "d_ratio((8 * cpu@de_no_dispatch_per_slot.no_ops_from_frontend\\,cmask\\=0x8@), total_dispatch_slots)",
47+
"MetricGroup": "PipelineL2;frontend_bound_group",
48+
"ScaleUnit": "100%slots"
49+
},
50+
{
51+
"MetricName": "frontend_bound_by_bandwidth",
52+
"BriefDescription": "Percentage of dispatch slots that remained unused because of a bandwidth bottleneck in the frontend (such as decode or op cache fetch bandwidth).",
53+
"MetricExpr": "d_ratio(de_no_dispatch_per_slot.no_ops_from_frontend - (8 * cpu@de_no_dispatch_per_slot.no_ops_from_frontend\\,cmask\\=0x8@), total_dispatch_slots)",
54+
"MetricGroup": "PipelineL2;frontend_bound_group",
55+
"ScaleUnit": "100%slots"
56+
},
57+
{
58+
"MetricName": "bad_speculation_from_mispredicts",
59+
"BriefDescription": "Percentage of dispatched ops that were flushed due to branch mispredicts.",
60+
"MetricExpr": "d_ratio(bad_speculation * ex_ret_brn_misp, ex_ret_brn_misp + bp_redirects.resync)",
61+
"MetricGroup": "PipelineL2;bad_speculation_group",
62+
"ScaleUnit": "100%ops"
63+
},
64+
{
65+
"MetricName": "bad_speculation_from_pipeline_restarts",
66+
"BriefDescription": "Percentage of dispatched ops that were flushed due to pipeline restarts (resyncs).",
67+
"MetricExpr": "d_ratio(bad_speculation * bp_redirects.resync, ex_ret_brn_misp + bp_redirects.resync)",
68+
"MetricGroup": "PipelineL2;bad_speculation_group",
69+
"ScaleUnit": "100%ops"
70+
},
71+
{
72+
"MetricName": "backend_bound_by_memory",
73+
"BriefDescription": "Percentage of dispatch slots that remained unused because of stalls due to the memory subsystem.",
74+
"MetricExpr": "backend_bound * d_ratio(ex_no_retire.load_not_complete, ex_no_retire.not_complete)",
75+
"MetricGroup": "PipelineL2;backend_bound_group",
76+
"ScaleUnit": "100%slots"
77+
},
78+
{
79+
"MetricName": "backend_bound_by_cpu",
80+
"BriefDescription": "Percentage of dispatch slots that remained unused because of stalls not related to the memory subsystem.",
81+
"MetricExpr": "backend_bound * (1 - d_ratio(ex_no_retire.load_not_complete, ex_no_retire.not_complete))",
82+
"MetricGroup": "PipelineL2;backend_bound_group",
83+
"ScaleUnit": "100%slots"
84+
},
85+
{
86+
"MetricName": "retiring_from_fastpath",
87+
"BriefDescription": "Percentage of dispatch slots used by fastpath ops that retired.",
88+
"MetricExpr": "retiring * (1 - d_ratio(ex_ret_ucode_ops, ex_ret_ops))",
89+
"MetricGroup": "PipelineL2;retiring_group",
90+
"ScaleUnit": "100%slots"
91+
},
92+
{
93+
"MetricName": "retiring_from_microcode",
94+
"BriefDescription": "Percentage of dispatch slots used by microcode ops that retired.",
95+
"MetricExpr": "retiring * d_ratio(ex_ret_ucode_ops, ex_ret_ops)",
96+
"MetricGroup": "PipelineL2;retiring_group",
97+
"ScaleUnit": "100%slots"
98+
}
99+
]

0 commit comments

Comments
 (0)