Skip to content

Commit 45c072f

Browse files
sandip4nacmel
authored andcommitted
perf vendor events amd: Add Zen 5 core events
Add core events taken from Section 1.4 "Core Performance Monitor Counters" of the Performance Monitor Counters for AMD Family 1Ah Model 00h-0Fh Processors document available at the link below. This constitutes events which capture information on op dispatch, execution and retirement, branch prediction, L1 and L2 cache activity, TLB activity, etc. 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/668d194241bf0d42dc37f1c5af8131069a0bd82c.1714717230.git.sandipan.das@amd.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
1 parent 8f283fb commit 45c072f

7 files changed

Lines changed: 1983 additions & 0 deletions

File tree

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
[
2+
{
3+
"EventName": "bp_l1_tlb_miss_l2_tlb_hit",
4+
"EventCode": "0x84",
5+
"BriefDescription": "Instruction fetches that miss in the L1 ITLB but hit in the L2 ITLB."
6+
},
7+
{
8+
"EventName": "bp_l1_tlb_miss_l2_tlb_miss.if4k",
9+
"EventCode": "0x85",
10+
"BriefDescription": "Instruction fetches that miss in both the L1 and L2 ITLBs (page-table walks are requested) for 4k pages.",
11+
"UMask": "0x01"
12+
},
13+
{
14+
"EventName": "bp_l1_tlb_miss_l2_tlb_miss.if2m",
15+
"EventCode": "0x85",
16+
"BriefDescription": "Instruction fetches that miss in both the L1 and L2 ITLBs (page-table walks are requested) for 2M pages.",
17+
"UMask": "0x02"
18+
},
19+
{
20+
"EventName": "bp_l1_tlb_miss_l2_tlb_miss.if1g",
21+
"EventCode": "0x85",
22+
"BriefDescription": "Instruction fetches that miss in both the L1 and L2 ITLBs (page-table walks are requested) for 1G pages.",
23+
"UMask": "0x04"
24+
},
25+
{
26+
"EventName": "bp_l1_tlb_miss_l2_tlb_miss.coalesced_4k",
27+
"EventCode": "0x85",
28+
"BriefDescription": "Instruction fetches that miss in both the L1 and L2 ITLBs (page-table walks are requested) for coalesced pages. A coalesced page is a 16k page created from four adjacent 4k pages.",
29+
"UMask": "0x08"
30+
},
31+
{
32+
"EventName": "bp_l1_tlb_miss_l2_tlb_miss.all",
33+
"EventCode": "0x85",
34+
"BriefDescription": "Instruction fetches that miss in both the L1 and L2 ITLBs (page-table walks are requested) for all page sizes.",
35+
"UMask": "0x0f"
36+
},
37+
{
38+
"EventName": "bp_l2_btb_correct",
39+
"EventCode": "0x8b",
40+
"BriefDescription": "L2 branch prediction overrides existing prediction (speculative)."
41+
},
42+
{
43+
"EventName": "bp_dyn_ind_pred",
44+
"EventCode": "0x8e",
45+
"BriefDescription": "Dynamic indirect predictions (branch used the indirect predictor to make a prediction)."
46+
},
47+
{
48+
"EventName": "bp_de_redirect",
49+
"EventCode": "0x91",
50+
"BriefDescription": "Number of times an early redirect is sent to branch predictor. This happens when either the decoder or dispatch logic is able to detect that the branch predictor needs to be redirected."
51+
},
52+
{
53+
"EventName": "bp_l1_tlb_fetch_hit.if4k",
54+
"EventCode": "0x94",
55+
"BriefDescription": "Instruction fetches that hit in the L1 ITLB for 4k or coalesced pages. A coalesced page is a 16k page created from four adjacent 4k pages.",
56+
"UMask": "0x01"
57+
},
58+
{
59+
"EventName": "bp_l1_tlb_fetch_hit.if2m",
60+
"EventCode": "0x94",
61+
"BriefDescription": "Instruction fetches that hit in the L1 ITLB for 2M pages.",
62+
"UMask": "0x02"
63+
},
64+
{
65+
"EventName": "bp_l1_tlb_fetch_hit.if1g",
66+
"EventCode": "0x94",
67+
"BriefDescription": "Instruction fetches that hit in the L1 ITLB for 1G pages.",
68+
"UMask": "0x04"
69+
},
70+
{
71+
"EventName": "bp_l1_tlb_fetch_hit.all",
72+
"EventCode": "0x94",
73+
"BriefDescription": "Instruction fetches that hit in the L1 ITLB for all page sizes.",
74+
"UMask": "0x07"
75+
},
76+
{
77+
"EventName": "bp_redirects.resync",
78+
"EventCode": "0x9f",
79+
"BriefDescription": "Redirects of the branch predictor caused by resyncs.",
80+
"UMask": "0x01"
81+
},
82+
{
83+
"EventName": "bp_redirects.ex_redir",
84+
"EventCode": "0x9f",
85+
"BriefDescription": "Redirects of the branch predictor caused by mispredicts.",
86+
"UMask": "0x02"
87+
},
88+
{
89+
"EventName": "bp_redirects.all",
90+
"EventCode": "0x9f",
91+
"BriefDescription": "Redirects of the branch predictor."
92+
}
93+
]
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
[
2+
{
3+
"EventName": "de_op_queue_empty",
4+
"EventCode": "0xa9",
5+
"BriefDescription": "Cycles where the op queue is empty. Such cycles indicate that the front-end is not delivering instructions fast enough."
6+
},
7+
{
8+
"EventName": "de_src_op_disp.x86_decoder",
9+
"EventCode": "0xaa",
10+
"BriefDescription": "Ops dispatched from x86 decoder.",
11+
"UMask": "0x01"
12+
},
13+
{
14+
"EventName": "de_src_op_disp.op_cache",
15+
"EventCode": "0xaa",
16+
"BriefDescription": "Ops dispatched from op cache.",
17+
"UMask": "0x02"
18+
},
19+
{
20+
"EventName": "de_src_op_disp.all",
21+
"EventCode": "0xaa",
22+
"BriefDescription": "Ops dispatched from any source.",
23+
"UMask": "0x07"
24+
},
25+
{
26+
"EventName": "de_dis_ops_from_decoder.any_fp_dispatch",
27+
"EventCode": "0xab",
28+
"BriefDescription": "Number of ops dispatched to the floating-point unit.",
29+
"UMask": "0x04"
30+
},
31+
{
32+
"EventName": "de_dis_ops_from_decoder.any_integer_dispatch",
33+
"EventCode": "0xab",
34+
"BriefDescription": "Number of ops dispatched to the integer execution unit.",
35+
"UMask": "0x08"
36+
},
37+
{
38+
"EventName": "de_dispatch_stall_cycle_dynamic_tokens_part1.int_phy_reg_file_rsrc_stall",
39+
"EventCode": "0xae",
40+
"BriefDescription": "Cycles where a dispatch group is valid but does not get dispatched due to an integer physical register file resource stall.",
41+
"UMask": "0x01"
42+
},
43+
{
44+
"EventName": "de_dispatch_stall_cycle_dynamic_tokens_part1.load_queue_rsrc_stall",
45+
"EventCode": "0xae",
46+
"BriefDescription": "Cycles where a dispatch group is valid but does not get dispatched due to a lack of load queue tokens.",
47+
"UMask": "0x02"
48+
},
49+
{
50+
"EventName": "de_dispatch_stall_cycle_dynamic_tokens_part1.store_queue_rsrc_stall",
51+
"EventCode": "0xae",
52+
"BriefDescription": "Cycles where a dispatch group is valid but does not get dispatched due to a lack of store queue tokens.",
53+
"UMask": "0x04"
54+
},
55+
{
56+
"EventName": "de_dispatch_stall_cycle_dynamic_tokens_part1.taken_brnch_buffer_rsrc",
57+
"EventCode": "0xae",
58+
"BriefDescription": "Cycles where a dispatch group is valid but does not get dispatched due to a taken branch buffer resource stall.",
59+
"UMask": "0x10"
60+
},
61+
{
62+
"EventName": "de_dispatch_stall_cycle_dynamic_tokens_part1.fp_sch_rsrc_stall",
63+
"EventCode": "0xae",
64+
"BriefDescription": "Cycles where a dispatch group is valid but does not get dispatched due to a floating-point non-schedulable queue token stall.",
65+
"UMask": "0x40"
66+
},
67+
{
68+
"EventName": "de_dispatch_stall_cycle_dynamic_tokens_part2.al_tokens",
69+
"EventCode": "0xaf",
70+
"BriefDescription": "Cycles where a dispatch group is valid but does not get dispatched due to unavailability of ALU tokens.",
71+
"UMask": "0x01"
72+
},
73+
{
74+
"EventName": "de_dispatch_stall_cycle_dynamic_tokens_part2.ag_tokens",
75+
"EventCode": "0xaf",
76+
"BriefDescription": "Cycles where a dispatch group is valid but does not get dispatched due to unavailability of agen tokens.",
77+
"UMask": "0x02"
78+
},
79+
{
80+
"EventName": "de_dispatch_stall_cycle_dynamic_tokens_part2.ex_flush_recovery",
81+
"EventCode": "0xaf",
82+
"BriefDescription": "Cycles where a dispatch group is valid but does not get dispatched due to a pending integer execution flush recovery.",
83+
"UMask": "0x04"
84+
},
85+
{
86+
"EventName": "de_dispatch_stall_cycle_dynamic_tokens_part2.retq",
87+
"EventCode": "0xaf",
88+
"BriefDescription": "Cycles where a dispatch group is valid but does not get dispatched due to unavailability of retire queue tokens.",
89+
"UMask": "0x20"
90+
},
91+
{
92+
"EventName": "de_no_dispatch_per_slot.no_ops_from_frontend",
93+
"EventCode": "0x1a0",
94+
"BriefDescription": "In each cycle counts dispatch slots left empty because the front-end did not supply ops.",
95+
"UMask": "0x01"
96+
},
97+
{
98+
"EventName": "de_no_dispatch_per_slot.backend_stalls",
99+
"EventCode": "0x1a0",
100+
"BriefDescription": "In each cycle counts ops unable to dispatch because of back-end stalls.",
101+
"UMask": "0x1e"
102+
},
103+
{
104+
"EventName": "de_no_dispatch_per_slot.smt_contention",
105+
"EventCode": "0x1a0",
106+
"BriefDescription": "In each cycle counts ops unable to dispatch because the dispatch cycle was granted to the other SMT thread.",
107+
"UMask": "0x60"
108+
},
109+
{
110+
"EventName": "de_additional_resource_stalls.dispatch_stalls",
111+
"EventCode": "0x1a2",
112+
"BriefDescription": "Counts additional cycles where dispatch is stalled due to a lack of dispatch resources.",
113+
"UMask": "0x30"
114+
}
115+
]
Lines changed: 174 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
1+
[
2+
{
3+
"EventName": "ex_ret_instr",
4+
"EventCode": "0xc0",
5+
"BriefDescription": "Retired instructions."
6+
},
7+
{
8+
"EventName": "ex_ret_ops",
9+
"EventCode": "0xc1",
10+
"BriefDescription": "Retired macro-ops."
11+
},
12+
{
13+
"EventName": "ex_ret_brn",
14+
"EventCode": "0xc2",
15+
"BriefDescription": "Retired branch instructions (all types of architectural control flow changes, including exceptions and interrupts)."
16+
},
17+
{
18+
"EventName": "ex_ret_brn_misp",
19+
"EventCode": "0xc3",
20+
"BriefDescription": "Retired branch instructions mispredicted."
21+
},
22+
{
23+
"EventName": "ex_ret_brn_tkn",
24+
"EventCode": "0xc4",
25+
"BriefDescription": "Retired taken branch instructions (all types of architectural control flow changes, including exceptions and interrupts)."
26+
},
27+
{
28+
"EventName": "ex_ret_brn_tkn_misp",
29+
"EventCode": "0xc5",
30+
"BriefDescription": "Retired taken branch instructions mispredicted."
31+
},
32+
{
33+
"EventName": "ex_ret_brn_far",
34+
"EventCode": "0xc6",
35+
"BriefDescription": "Retired far control transfers (far call/jump/return, IRET, SYSCALL and SYSRET, plus exceptions and interrupts). Far control transfers are not subject to branch prediction."
36+
},
37+
{
38+
"EventName": "ex_ret_near_ret",
39+
"EventCode": "0xc8",
40+
"BriefDescription": "Retired near returns (RET or RET Iw)."
41+
},
42+
{
43+
"EventName": "ex_ret_near_ret_mispred",
44+
"EventCode": "0xc9",
45+
"BriefDescription": "Retired near returns mispredicted. Each misprediction incurs the same penalty as a mispredicted conditional branch instruction."
46+
},
47+
{
48+
"EventName": "ex_ret_brn_ind_misp",
49+
"EventCode": "0xca",
50+
"BriefDescription": "Retired indirect branch instructions mispredicted (only EX mispredicts). Each misprediction incurs the same penalty as a mispredicted conditional branch instruction."
51+
},
52+
{
53+
"EventName": "ex_ret_mmx_fp_instr.x87",
54+
"EventCode": "0xcb",
55+
"BriefDescription": "Retired x87 instructions.",
56+
"UMask": "0x01"
57+
},
58+
{
59+
"EventName": "ex_ret_mmx_fp_instr.mmx",
60+
"EventCode": "0xcb",
61+
"BriefDescription": "Retired MMX instructions.",
62+
"UMask": "0x02"
63+
},
64+
{
65+
"EventName": "ex_ret_mmx_fp_instr.sse",
66+
"EventCode": "0xcb",
67+
"BriefDescription": "Retired SSE instructions (includes SSE, SSE2, SSE3, SSSE3, SSE4A, SSE41, SSE42 and AVX).",
68+
"UMask": "0x04"
69+
},
70+
{
71+
"EventName": "ex_ret_ind_brch_instr",
72+
"EventCode": "0xcc",
73+
"BriefDescription": "Retired indirect branch instructions."
74+
},
75+
{
76+
"EventName": "ex_ret_cond",
77+
"EventCode": "0xd1",
78+
"BriefDescription": "Retired conditional branch instructions."
79+
},
80+
{
81+
"EventName": "ex_div_busy",
82+
"EventCode": "0xd3",
83+
"BriefDescription": "Number of cycles the divider is busy."
84+
},
85+
{
86+
"EventName": "ex_div_count",
87+
"EventCode": "0xd4",
88+
"BriefDescription": "Divide ops executed."
89+
},
90+
{
91+
"EventName": "ex_no_retire.empty",
92+
"EventCode": "0xd6",
93+
"BriefDescription": "Cycles with no retire due to the lack of valid ops in the retire queue (may be caused by front-end bottlenecks or pipeline redirects).",
94+
"UMask": "0x01"
95+
},
96+
{
97+
"EventName": "ex_no_retire.not_complete",
98+
"EventCode": "0xd6",
99+
"BriefDescription": "Cycles with no retire while the oldest op is waiting to be executed.",
100+
"UMask": "0x02"
101+
},
102+
{
103+
"EventName": "ex_no_retire.other",
104+
"EventCode": "0xd6",
105+
"BriefDescription": "Cycles with no retire caused by other reasons (retire breaks, traps, faults, etc.).",
106+
"UMask": "0x08"
107+
},
108+
{
109+
"EventName": "ex_no_retire.thread_not_selected",
110+
"EventCode": "0xd6",
111+
"BriefDescription": "Cycles with no retire because thread arbitration did not select the thread.",
112+
"UMask": "0x10"
113+
},
114+
{
115+
"EventName": "ex_no_retire.load_not_complete",
116+
"EventCode": "0xd6",
117+
"BriefDescription": "Cycles with no retire while the oldest op is waiting for load data.",
118+
"UMask": "0xa2"
119+
},
120+
{
121+
"EventName": "ex_no_retire.all",
122+
"EventCode": "0xd6",
123+
"BriefDescription": "Cycles with no retire for any reason.",
124+
"UMask": "0x1b"
125+
},
126+
{
127+
"EventName": "ex_ret_ucode_instr",
128+
"EventCode": "0x1c1",
129+
"BriefDescription": "Retired microcoded instructions."
130+
},
131+
{
132+
"EventName": "ex_ret_ucode_ops",
133+
"EventCode": "0x1c2",
134+
"BriefDescription": "Retired microcode ops."
135+
},
136+
{
137+
"EventName": "ex_ret_msprd_brnch_instr_dir_msmtch",
138+
"EventCode": "0x1c7",
139+
"BriefDescription": "Retired branch instructions mispredicted due to direction mismatch."
140+
},
141+
{
142+
"EventName": "ex_ret_uncond_brnch_instr_mispred",
143+
"EventCode": "0x1c8",
144+
"BriefDescription": "Retired unconditional indirect branch instructions mispredicted."
145+
},
146+
{
147+
"EventName": "ex_ret_uncond_brnch_instr",
148+
"EventCode": "0x1c9",
149+
"BriefDescription": "Retired unconditional branch instructions."
150+
},
151+
{
152+
"EventName": "ex_tagged_ibs_ops.ibs_tagged_ops",
153+
"EventCode": "0x1cf",
154+
"BriefDescription": "Ops tagged by IBS.",
155+
"UMask": "0x01"
156+
},
157+
{
158+
"EventName": "ex_tagged_ibs_ops.ibs_tagged_ops_ret",
159+
"EventCode": "0x1cf",
160+
"BriefDescription": "Ops tagged by IBS that retired.",
161+
"UMask": "0x02"
162+
},
163+
{
164+
"EventName": "ex_tagged_ibs_ops.ibs_count_rollover",
165+
"EventCode": "0x1cf",
166+
"BriefDescription": "Ops not tagged by IBS due to a previous tagged op that has not yet signaled interrupt.",
167+
"UMask": "0x04"
168+
},
169+
{
170+
"EventName": "ex_ret_fused_instr",
171+
"EventCode": "0x1d0",
172+
"BriefDescription": "Retired fused instructions."
173+
}
174+
]

0 commit comments

Comments
 (0)