Skip to content

Commit 6550483

Browse files
authored
Prepare metrics for GNR on Cloud VMs (#389)
* add metrics and events for GNR when the fixed tma register isn't available Signed-off-by: Harper, Jason M <[email protected]> * fix core bound Signed-off-by: Harper, Jason M <[email protected]> * remove customized PEBs events for C4 Signed-off-by: Harper, Jason M <[email protected]> --------- Signed-off-by: Harper, Jason M <[email protected]>
1 parent 1dd8a24 commit 6550483

File tree

4 files changed

+701
-5
lines changed

4 files changed

+701
-5
lines changed

cmd/metrics/event_defs.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func LoadEventGroups(eventDefinitionOverridePath string, metadata Metadata) (gro
4343
uarch = strings.Split(uarch, " ")[0]
4444
// use alternate events/metrics when TMA fixed counters are not supported
4545
alternate := ""
46-
if (uarch == "icx" || uarch == "spr" || uarch == "emr") && !metadata.SupportsFixedTMA { // AWS VM instances
46+
if (uarch == "icx" || uarch == "spr" || uarch == "emr" || uarch == "gnr") && !metadata.SupportsFixedTMA { // AWS/GCP VM instances
4747
alternate = "_nofixedtma"
4848
}
4949
eventFileName := fmt.Sprintf("%s%s.txt", uarch, alternate)
@@ -145,9 +145,13 @@ func isCollectableEvent(event EventDefinition, metadata Metadata) bool {
145145
}
146146
// PEBS events (not supported on GCP c4 VMs)
147147
pebsEventNames := []string{"INT_MISC.UNKNOWN_BRANCH_CYCLES", "UOPS_RETIRED.MS"}
148-
if !metadata.SupportsPEBS && slices.Contains(pebsEventNames, event.Name) {
149-
slog.Debug("PEBS events not supported on target", slog.String("event", event.Name))
150-
return false
148+
if !metadata.SupportsPEBS {
149+
for _, pebsEventName := range pebsEventNames {
150+
if strings.Contains(event.Name, pebsEventName) {
151+
slog.Debug("PEBS events not supported on target", slog.String("event", event.Name))
152+
return false
153+
}
154+
}
151155
}
152156
// short-circuit for cpu events that aren't off-core response events
153157
if event.Device == "cpu" && !(strings.HasPrefix(event.Name, "OCR") || strings.HasPrefix(event.Name, "OFFCORE_REQUESTS_OUTSTANDING")) {

cmd/metrics/metric_defs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func LoadMetricDefinitions(metricDefinitionOverridePath string, selectedMetrics
4343
uarch = strings.Split(uarch, " ")[0]
4444
// use alternate events/metrics when TMA fixed counters are not supported
4545
alternate := ""
46-
if (uarch == "icx" || uarch == "spr" || uarch == "emr") && !metadata.SupportsFixedTMA {
46+
if (uarch == "icx" || uarch == "spr" || uarch == "emr" || uarch == "gnr") && !metadata.SupportsFixedTMA {
4747
alternate = "_nofixedtma"
4848
}
4949
metricFileName := fmt.Sprintf("%s%s.json", uarch, alternate)
Lines changed: 214 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,214 @@
1+
# GraniteRapids event list
2+
3+
# cpu groups
4+
cpu/event=0x51,umask=0x01,period=100003,name='L1D.REPLACEMENT'/, # 0,1,2,3
5+
cpu/event=0x24,umask=0xe4,period=200003,name='L2_RQSTS.ALL_CODE_RD'/, # 0,1,2,3
6+
cpu/event=0xd1,umask=0x01,period=1000003,name='MEM_LOAD_RETIRED.L1_HIT'/, # 0,1,2,3
7+
cpu/event=0x25,umask=0x1f,period=100003,name='L2_LINES_IN.ALL'/, # 0,1,2,3
8+
cpu/event=0xec,umask=0x02,period=2000003,name='CPU_CLK_UNHALTED.DISTRIBUTED'/,
9+
cpu/event=0xb7,umask=0x02,period=2000003,name='EXE.AMX_BUSY'/,
10+
cpu-cycles,
11+
ref-cycles,
12+
instructions;
13+
14+
cpu/event=0xd1,umask=0x10,period=100021,name='MEM_LOAD_RETIRED.L2_MISS'/, # 0,1,2,3
15+
cpu/event=0x24,umask=0x24,period=200003,name='L2_RQSTS.CODE_RD_MISS'/, # 0,1,2,3
16+
cpu/event=0x11,umask=0x0e,period=100003,name='ITLB_MISSES.WALK_COMPLETED'/, # 0,1,2,3
17+
cpu/event=0x47,umask=0x03,cmask=0x03,period=1000003,name='MEMORY_ACTIVITY.STALLS_L1D_MISS'/, # 0,1,2,3
18+
cpu/event=0xa6,umask=0x40,cmask=0x02,period=1000003,name='EXE_ACTIVITY.BOUND_ON_STORES'/,
19+
cpu/event=0xa6,umask=0x21,cmask=0x05,period=2000003,name='EXE_ACTIVITY.BOUND_ON_LOADS'/,
20+
cpu/event=0xad,umask=0x10,period=1000003,name='INT_MISC.UOP_DROPPING'/,
21+
cpu/event=0xad,umask=0x40,period=1000003,name='INT_MISC.UNKNOWN_BRANCH_CYCLES'/, # [*]
22+
cpu-cycles,
23+
ref-cycles,
24+
instructions;
25+
26+
cpu/event=0xe5,umask=0x03,period=1000003,name='MEM_UOP_RETIRED.ANY'/,
27+
cpu/event=0xc0,umask=0x10,period=2000003,name='INST_RETIRED.MACRO_FUSED'/,
28+
cpu/event=0xc4,umask=0x00,period=400009,name='BR_INST_RETIRED.ALL_BRANCHES'/,
29+
cpu/event=0xc5,umask=0x00,period=400009,name='BR_MISP_RETIRED.ALL_BRANCHES'/,
30+
cpu/event=0x12,umask=0x0e,period=100003,name='DTLB_LOAD_MISSES.WALK_COMPLETED'/, # 0,1,2,3
31+
cpu/event=0x12,umask=0x04,period=100003,name='DTLB_LOAD_MISSES.WALK_COMPLETED_2M_4M'/, # 0,1,2,3
32+
cpu/event=0x13,umask=0x0e,period=100003,name='DTLB_STORE_MISSES.WALK_COMPLETED'/, # 0,1,2,3
33+
cpu/event=0xd1,umask=0x02,period=200003,name='MEM_LOAD_RETIRED.L2_HIT'/, # 0,1,2,3
34+
cpu-cycles,
35+
ref-cycles,
36+
instructions;
37+
38+
cpu/event=0x47,umask=0x09,cmask=0x09,period=1000003,name='MEMORY_ACTIVITY.STALLS_L3_MISS'/, # 0,1,2,3
39+
cpu/event=0x80,umask=0x04,period=500009,name='ICACHE_DATA.STALLS'/, # 0,1,2,3
40+
cpu/event=0x83,umask=0x04,period=200003,name='ICACHE_TAG.STALLS'/, # 0,1,2,3
41+
cpu/event=0xc2,umask=0x02,period=2000003,name='UOPS_RETIRED.SLOTS'/,
42+
cpu/event=0xae,umask=0x01,period=2000003,name='UOPS_ISSUED.ANY'/;
43+
cpu-cycles,
44+
ref-cycles,
45+
instructions;
46+
47+
cpu/event=0x47,umask=0x03,cmask=0x03,period=1000003,name='MEMORY_ACTIVITY.STALLS_L1D_MISS'/, # 0,1,2,3
48+
cpu/event=0x47,umask=0x05,cmask=0x05,period=1000003,name='MEMORY_ACTIVITY.STALLS_L2_MISS'/, # 0,1,2,3
49+
cpu/event=0x12,umask=0x10,cmask=0x01,period=100003,name='DTLB_LOAD_MISSES.WALK_ACTIVE'/, # 0,1,2,3
50+
cpu/event=0xa3,umask=0x10,cmask=0x10,period=1000003,name='CYCLE_ACTIVITY.CYCLES_MEM_ANY'/,
51+
cpu/event=0xad,umask=0x80,period=500009,name='INT_MISC.CLEAR_RESTEER_CYCLES'/,
52+
cpu/event=0xec,umask=0x02,period=2000003,name='CPU_CLK_UNHALTED.DISTRIBUTED'/,
53+
cpu/event=0xd1,umask=0x08,period=200003,name='MEM_LOAD_RETIRED.L1_MISS'/, # 0,1,2,3
54+
cpu/event=0xc2,umask=0x04,period=2000003,name='UOPS_RETIRED.MS'/, # [*]
55+
cpu-cycles,
56+
ref-cycles,
57+
instructions;
58+
59+
cpu/event=0xc2,umask=0x04,cmask=0x01,period=2000003,name='UOPS_RETIRED.MS:c1'/, # [*]
60+
cpu/event=0xd0,umask=0x21,period=100007,name='MEM_INST_RETIRED.LOCK_LOADS'/, # 0,1,2,3
61+
cpu/event=0xd0,umask=0x82,period=1000003,name='MEM_INST_RETIRED.ALL_STORES'/, # 0,1,2,3
62+
cpu-cycles,
63+
ref-cycles,
64+
instructions;
65+
66+
cpu/event=0xc2,umask=0x04,cmask=0x01,period=2000003,name='UOPS_RETIRED.MS:c1:e1'/, # [*]
67+
cpu/event=0x2a,umask=0x01,period=100003,offcore_rsp=0x8003C0001,name='OCR.DEMAND_DATA_RD.L3_HIT.SNOOP_HIT_WITH_FWD'/, # 0,1,2,3
68+
cpu/event=0x2b,umask=0x01,period=100003,offcore_rsp=0x10003C0002,name='OCR.DEMAND_RFO.L3_HIT.SNOOP_HITM'/, # 0,1,2,3
69+
cpu/event=0x20,umask=0x04,cmask=0x01,period=1000003,name='OFFCORE_REQUESTS_OUTSTANDING.CYCLES_WITH_DEMAND_RFO'/, # 0,1,2,3
70+
cpu/event=0xd1,umask=0x40,period=100007,name='MEM_LOAD_RETIRED.FB_HIT'/, # 0,1,2,3
71+
cpu-cycles,
72+
ref-cycles,
73+
instructions;
74+
75+
cpu/event=0xd2,umask=0x02,period=20011,name='MEM_LOAD_L3_HIT_RETIRED.XSNP_NO_FWD'/, # 0,1,2,3
76+
cpu/event=0xd2,umask=0x04,period=20011,name='MEM_LOAD_L3_HIT_RETIRED.XSNP_FWD'/, # 0,1,2,3
77+
cpu/event=0x47,umask=0x02,cmask=0x02,period=1000003,name='MEMORY_ACTIVITY.CYCLES_L1D_MISS'/, # 0,1,2,3
78+
cpu/event=0xc5,umask=0x50,period=400009,name='BR_MISP_RETIRED.COND_NTAKEN_COST'/,
79+
cpu/event=0xc5,umask=0x41,period=400009,name='BR_MISP_RETIRED.COND_TAKEN_COST'/,
80+
cpu/event=0xc5,umask=0x42,period=400009,name='BR_MISP_RETIRED.INDIRECT_CALL_COST'/,
81+
cpu/event=0xc5,umask=0xc0,period=100003,name='BR_MISP_RETIRED.INDIRECT_COST'/,
82+
cpu/event=0xc5,umask=0x48,period=100007,name='BR_MISP_RETIRED.RET_COST'/,
83+
cpu-cycles,
84+
ref-cycles,
85+
instructions;
86+
87+
cpu/event=0x79,umask=0x08,period=2000003,name='IDQ.DSB_UOPS'/, # 0,1,2,3
88+
cpu/event=0x79,umask=0x04,period=2000003,name='IDQ.MITE_UOPS'/, # 0,1,2,3
89+
cpu/event=0x79,umask=0x20,period=1000003,name='IDQ.MS_UOPS'/, # 0,1,2,3
90+
cpu/event=0xa8,umask=0x01,period=2000003,name='LSD.UOPS'/,
91+
cpu-cycles,
92+
ref-cycles,
93+
instructions;
94+
95+
cpu/event=0x2a,umask=0x01,period=100003,offcore_rsp=0x1030004477,name='OCR.READS_TO_CORE.REMOTE_CACHE.SNOOP_HITM'/, # 0,1,2,3
96+
cpu/event=0x2a,umask=0x01,period=100003,offcore_rsp=0x830004477,name='OCR.READS_TO_CORE.REMOTE_CACHE.SNOOP_HIT_WITH_FWD'/, # 0,1,2,3
97+
cpu/event=0xb0,umask=0x09,cmask=0x01,period=1000003,name='ARITH.DIV_ACTIVE'/,
98+
cpu/event=0xa2,umask=0x02,period=100003,name='RESOURCE_STALLS.SCOREBOARD'/,
99+
cpu/event=0xec,umask=0x20,period=2000003,name='CPU_CLK_UNHALTED.C02'/,
100+
cpu-cycles:k,
101+
ref-cycles:k,
102+
instructions:k;
103+
104+
cpu/event=0x87,umask=0x01,period=500009,name='DECODE.LCP'/, # 0,1,2,3
105+
cpu/event=0x61,umask=0x02,period=100003,name='DSB2MITE_SWITCHES.PENALTY_CYCLES'/, # 0,1,2,3
106+
cpu/event=0x79,umask=0x04,cmask=0x01,period=2000003,name='IDQ.MITE_CYCLES_ANY'/, # 0,1,2,3
107+
cpu/event=0x79,umask=0x04,cmask=0x06,period=2000003,name='IDQ.MITE_CYCLES_OK'/, # 0,1,2,3
108+
cpu-cycles,
109+
ref-cycles,
110+
instructions;
111+
112+
cpu/event=0x79,umask=0x08,cmask=0x01,period=2000003,name='IDQ.DSB_CYCLES_ANY'/, # 0,1,2,3
113+
cpu/event=0x79,umask=0x08,cmask=0x06,period=2000003,name='IDQ.DSB_CYCLES_OK'/, # 0,1,2,3
114+
cpu/event=0x79,umask=0x20,cmask=0x01,period=2000003,name='IDQ.MS_CYCLES_ANY'/, # 0,1,2,3
115+
cpu-cycles,
116+
ref-cycles,
117+
instructions;
118+
119+
cpu/event=0xad,umask=0x01,cmask=0x01,period=500009,name='INT_MISC.CLEARS_COUNT'/,
120+
cpu/event=0xc3,umask=0x01,cmask=0x01,period=100003,name='MACHINE_CLEARS.COUNT'/,
121+
cpu/event=0xc3,umask=0x02,period=100003,name='MACHINE_CLEARS.MEMORY_ORDERING'/,
122+
cpu/event=0xd0,umask=0x09,period=100003,name='MEM_INST_RETIRED.STLB_HIT_LOADS'/, # 0,1,2,3
123+
cpu/event=0x03,umask=0x82,period=100003,name='LD_BLOCKS.STORE_FORWARD'/, # 0,1,2,3
124+
cpu/event=0xd0,umask=0x81,period=1000003,name='MEM_INST_RETIRED.ALL_LOADS'/, # 0,1,2,3
125+
cpu/event=0xd0,umask=0x41,period=100003,name='MEM_INST_RETIRED.SPLIT_LOADS'/, # 0,1,2,3
126+
cpu-cycles,
127+
ref-cycles,
128+
instructions;
129+
130+
cpu/event=0x48,umask=0x01,period=1000003,name='L1D_PEND_MISS.PENDING'/, # 0,1,2,3
131+
cpu/event=0x43,umask=0xfd,period=1000003,name='MEM_LOAD_COMPLETED.L1_MISS_ANY'/, # 0,1,2,3
132+
cpu/event=0x48,umask=0x02,period=1000003,name='L1D_PEND_MISS.FB_FULL'/, # 0,1,2,3
133+
cpu/event=0xd2,umask=0x01,period=20011,name='MEM_LOAD_L3_HIT_RETIRED.XSNP_MISS'/, # 0,1,2,3
134+
cpu/event=0x9c,umask=0x01,period=1000003,name='IDQ_BUBBLES.CORE'/,
135+
cpu/event=0x9c,umask=0x01,cmask=0x06,period=1000003,name='IDQ_BUBBLES.CYCLES_0_UOPS_DELIV.CORE'/;
136+
cpu-cycles,
137+
ref-cycles,
138+
instructions;
139+
140+
cpu/event=0xa4,umask=0x01,period=10000003,name='TOPDOWN.SLOTS_P'/,
141+
cpu/event=0xa4,umask=0x02,period=10000003,name='TOPDOWN.BACKEND_BOUND_SLOTS'/,
142+
cpu/event=0xa4,umask=0x08,period=10000003,name='TOPDOWN.BR_MISPREDICT_SLOTS'/, # 0
143+
cpu/event=0xa4,umask=0x10,period=10000003,name='TOPDOWN.MEMORY_BOUND_SLOTS'/,
144+
cpu/event=0xc2,umask=0x01,period=2000003,name='UOPS_RETIRED.HEAVY'/,
145+
cpu-cycles,
146+
ref-cycles,
147+
instructions;
148+
149+
cpu/event=0xd1,umask=0x04,period=100021,name='MEM_LOAD_RETIRED.L3_HIT'/, # 0,1,2,3
150+
cpu/event=0x2d,umask=0x01,cmask=0x01,period=1000003,name='XQ.FULL_CYCLES'/, # 0,1,2,3
151+
cpu-cycles,
152+
ref-cycles,
153+
instructions;
154+
155+
cpu/event=0x48,umask=0x04,period=1000003,name='L1D_PEND_MISS.L2_STALLS'/, # 0,1,2,3
156+
cpu/event=0x44,umask=0x01,period=200003,name='MEM_STORE_RETIRED.L2_HIT'/, # 0,1,2,3
157+
cpu/event=0x2a,umask=0x01,period=100003,offcore_rsp=0x103b800002,name='OCR.DEMAND_RFO.L3_MISS'/, # 0,1,2,3
158+
cpu/event=0xd0,umask=0x42,period=100003,name='MEM_INST_RETIRED.SPLIT_STORES'/, # 0,1,2,3
159+
cpu-cycles,
160+
ref-cycles,
161+
instructions;
162+
163+
cpu/event=0x2a,umask=0x01,period=100003,offcore_rsp=0x10800,name='OCR.STREAMING_WR.ANY_RESPONSE'/, # 0,1,2,3
164+
cpu/event=0xd0,umask=0x0a,period=100003,name='MEM_INST_RETIRED.STLB_HIT_STORES'/, # 0,1,2,3
165+
cpu/event=0x13,umask=0x10,cmask=0x01,period=100003,name='DTLB_STORE_MISSES.WALK_ACTIVE'/, # 0,1,2,3
166+
cpu-cycles,
167+
ref-cycles,
168+
instructions;
169+
170+
cpu/event=0x2a,umask=0x01,period=100003,offcore_rsp=0x1030004477,name='OCR.DEMAND_DATA_RD.L3_HIT.SNOOP_HITM'/, # 0,1,2,3
171+
cpu/event=0x20,umask=0x08,cmask=0x01,period=1000003,name='OFFCORE_REQUESTS_OUTSTANDING.CYCLES_WITH_DATA_RD'/, # 0,1,2,3
172+
cpu/event=0x20,umask=0x08,cmask=0x04,period=1000003,name='OFFCORE_REQUESTS_OUTSTANDING.DATA_RD:c4'/, # 0,1,2,3
173+
cpu-cycles,
174+
ref-cycles,
175+
instructions;
176+
177+
# upi groups
178+
upi/event=0x02,umask=0x0f,name='UNC_UPI_TxL_FLITS.ALL_DATA'/; # 0,1,2,3
179+
180+
# cha groups
181+
cha/event=0x35,umask=0xc80ffe01,name='UNC_CHA_TOR_INSERTS.IA_MISS_CRD'/, # 0,1,2,3
182+
cha/event=0x35,umask=0xc8177e01,name='UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE'/, # 0,1,2,3
183+
cha/event=0x36,umask=0xc8177e01,name='UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE'/; # 0
184+
185+
cha/event=0x35,umask=0xc816fe01,name='UNC_CHA_TOR_INSERTS.IA_MISS_DRD_LOCAL'/, # 0,1,2,3
186+
cha/event=0x36,umask=0xc816fe01,name='UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_LOCAL'/, # 0
187+
cha/event=0x35,umask=0xc896fe01,name='UNC_CHA_TOR_INSERTS.IA_MISS_DRD_PREF_LOCAL'/, # 0,1,2,3
188+
cha/event=0x35,umask=0xc8977e01,name='UNC_CHA_TOR_INSERTS.IA_MISS_DRD_PREF_REMOTE'/; # 0,1,2,3
189+
190+
cha/event=0x35,umask=0xccd7fe01,name='UNC_CHA_TOR_INSERTS.IA_MISS_LLCPREFDATA'/, # 0,1,2,3
191+
cha/event=0x35,umask=0xc817fe01,name='UNC_CHA_TOR_INSERTS.IA_MISS_DRD'/, # 0,1,2,3
192+
cha/event=0x35,umask=0xc897fe01,name='UNC_CHA_TOR_INSERTS.IA_MISS_DRD_PREF'/, # 0,1,2,3
193+
cha/event=0x36,umask=0xc817fe01,name='UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD'/; # 0
194+
195+
cha/event=0x35,umask=0xc8f3ff04,name='UNC_CHA_TOR_INSERTS.IO_PCIRDCUR'/, # 0,1,2,3
196+
cha/event=0x35,umask=0xcc43ff04,name='UNC_CHA_TOR_INSERTS.IO_ITOM'/, # 0,1,2,3
197+
cha/event=0x35,umask=0xcd43ff04,name='UNC_CHA_TOR_INSERTS.IO_ITOMCACHENEAR'/, # 0,1,2,3
198+
cha/event=0x01,umask=0x00,name='UNC_CHA_CLOCKTICKS'/; # 0,1,2,3
199+
200+
# imc groups
201+
imc/event=0x05,umask=0xcf,name='UNC_M_CAS_COUNT_SCH0.RD'/, # 0,1,2,3
202+
imc/event=0x06,umask=0xcf,name='UNC_M_CAS_COUNT_SCH1.RD'/, # 0,1,2,3
203+
imc/event=0x05,umask=0xf0,name='UNC_M_CAS_COUNT_SCH0.WR'/, # 0,1,2,3
204+
imc/event=0x06,umask=0xf0,name='UNC_M_CAS_COUNT_SCH1.WR'/; # 0,1,2,3
205+
206+
# cstate_core groups
207+
cstate_core/c6-residency/;
208+
209+
# cstate_pkg groups
210+
cstate_pkg/c6-residency/;
211+
212+
# power groups
213+
power/energy-pkg/,
214+
power/energy-ram/;

0 commit comments

Comments
 (0)