Skip to content

Commit aba4cb3

Browse files
sandip4nacmel
authored andcommitted
perf vendor events amd: Add Zen 4 metrics
Add metrics taken from Section 2.1.15.2 "Performance Measurement" in the Processor Programming Reference (PPR) for AMD Family 19h Model 11h Revision B1 processors. The recommended metrics are sourced from Table 27 "Guidance for Common Performance Statistics with Complex Event Selects". The pipeline utilization metrics are sourced from Table 28 "Guidance for Pipeline Utilization Analysis Statistics". These are new to Zen 4 processors and useful for finding performance bottlenecks by analyzing activity at different stages of the pipeline. Metric groups have been added for Level 1 and Level 2 analysis. Signed-off-by: Sandipan Das <[email protected]> Acked-by: Ian Rogers <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Ananth Narayan <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Jirka Hladky <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Ravi Bangoria <[email protected]> Cc: Stephane Eranian <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent 5b2ca34 commit aba4cb3

File tree

2 files changed

+432
-0
lines changed

2 files changed

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

0 commit comments

Comments
 (0)