Skip to content

Commit ccc66c6

Browse files
captain5050acmel
authored andcommitted
perf metric: JSON flag to not group events if gathering a metric group
Some metric groups have metrics that don't have fully overlapping events, meaning that the group's events become unique event groups that may need to multiplex with each other. This can be particularly unfortunate when the groups wouldn't need to multiplex because there are sufficient hardware counters. Add a flag so that if recording a metric group then the metrics within the group needn't use groups for their events. The flag is added to Intel TopdownL1 and TopdownL2 metrics. Signed-off-by: Ian Rogers <[email protected]> Tested-by: Kan Liang <[email protected]> Cc: Adrian Hunter <[email protected]> Cc: Ahmad Yasin <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Andi Kleen <[email protected]> Cc: Athira Rajeev <[email protected]> Cc: Caleb Biggers <[email protected]> Cc: Edward Baker <[email protected]> Cc: Florian Fischer <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: James Clark <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: John Garry <[email protected]> Cc: Kajol Jain <[email protected]> Cc: Kang Minchul <[email protected]> Cc: Leo Yan <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Perry Taylor <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Ravi Bangoria <[email protected]> Cc: Rob Herring <[email protected]> Cc: Samantha Alt <[email protected]> Cc: Stephane Eranian <[email protected]> Cc: Sumanth Korikkar <[email protected]> Cc: Suzuki Poulouse <[email protected]> Cc: Thomas Richter <[email protected]> Cc: Tiezhu Yang <[email protected]> Cc: Weilin Wang <[email protected]> Cc: Xing Zhengjun <[email protected]> Cc: Yang Jihong <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent 1b11482 commit ccc66c6

File tree

21 files changed

+240
-5
lines changed

21 files changed

+240
-5
lines changed

tools/perf/pmu-events/arch/x86/alderlake/adl-metrics.json

Lines changed: 26 additions & 0 deletions
Large diffs are not rendered by default.

tools/perf/pmu-events/arch/x86/alderlaken/adln-metrics.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@
9898
"MetricGroup": "TopdownL1;tma_L1_group",
9999
"MetricName": "tma_backend_bound",
100100
"MetricThreshold": "tma_backend_bound > 0.1",
101+
"MetricgroupNoGroup": "TopdownL1",
101102
"PublicDescription": "Counts the total number of issue slots that were not consumed by the backend due to backend stalls. Note that uops must be available for consumption in order for this event to count. If a uop is not available (IQ is empty), this event will not count. The rest of these subevents count backend stalls, in cycles, due to an outstanding request which is memory bound vs core bound. The subevents are not slot based events and therefore can not be precisely added or subtracted from the Backend_Bound_Aux subevents which are slot based.",
102103
"ScaleUnit": "100%"
103104
},
@@ -107,6 +108,7 @@
107108
"MetricGroup": "TopdownL1;tma_L1_group",
108109
"MetricName": "tma_backend_bound_aux",
109110
"MetricThreshold": "tma_backend_bound_aux > 0.2",
111+
"MetricgroupNoGroup": "TopdownL1",
110112
"PublicDescription": "Counts the total number of issue slots that were not consumed by the backend due to backend stalls. Note that UOPS must be available for consumption in order for this event to count. If a uop is not available (IQ is empty), this event will not count. All of these subevents count backend stalls, in slots, due to a resource limitation. These are not cycle based events and therefore can not be precisely added or subtracted from the Backend_Bound subevents which are cycle based. These subevents are supplementary to Backend_Bound and can be used to analyze results from a resource perspective at allocation.",
111113
"ScaleUnit": "100%"
112114
},
@@ -116,6 +118,7 @@
116118
"MetricGroup": "TopdownL1;tma_L1_group",
117119
"MetricName": "tma_bad_speculation",
118120
"MetricThreshold": "tma_bad_speculation > 0.15",
121+
"MetricgroupNoGroup": "TopdownL1",
119122
"PublicDescription": "Counts the total number of issue slots that were not consumed by the backend because allocation is stalled due to a mispredicted jump or a machine clear. Only issue slots wasted due to fast nukes such as memory ordering nukes are counted. Other nukes are not accounted for. Counts all issue slots blocked during this recovery window including relevant microcode flows and while uops are not yet available in the instruction queue (IQ). Also includes the issue slots that were consumed by the backend but were thrown away because they were younger than the mispredict or machine clear.",
120123
"ScaleUnit": "100%"
121124
},
@@ -125,6 +128,7 @@
125128
"MetricGroup": "TopdownL2;tma_L2_group;tma_retiring_group",
126129
"MetricName": "tma_base",
127130
"MetricThreshold": "tma_base > 0.6",
131+
"MetricgroupNoGroup": "TopdownL2",
128132
"ScaleUnit": "100%"
129133
},
130134
{
@@ -142,6 +146,7 @@
142146
"MetricGroup": "TopdownL2;tma_L2_group;tma_bad_speculation_group",
143147
"MetricName": "tma_branch_mispredicts",
144148
"MetricThreshold": "tma_branch_mispredicts > 0.05",
149+
"MetricgroupNoGroup": "TopdownL2",
145150
"ScaleUnit": "100%"
146151
},
147152
{
@@ -166,6 +171,7 @@
166171
"MetricGroup": "TopdownL2;tma_L2_group;tma_backend_bound_group",
167172
"MetricName": "tma_core_bound",
168173
"MetricThreshold": "tma_core_bound > 0.1",
174+
"MetricgroupNoGroup": "TopdownL2",
169175
"ScaleUnit": "100%"
170176
},
171177
{
@@ -207,6 +213,7 @@
207213
"MetricGroup": "TopdownL2;tma_L2_group;tma_frontend_bound_group",
208214
"MetricName": "tma_fetch_bandwidth",
209215
"MetricThreshold": "tma_fetch_bandwidth > 0.1",
216+
"MetricgroupNoGroup": "TopdownL2",
210217
"ScaleUnit": "100%"
211218
},
212219
{
@@ -215,6 +222,7 @@
215222
"MetricGroup": "TopdownL2;tma_L2_group;tma_frontend_bound_group",
216223
"MetricName": "tma_fetch_latency",
217224
"MetricThreshold": "tma_fetch_latency > 0.15",
225+
"MetricgroupNoGroup": "TopdownL2",
218226
"ScaleUnit": "100%"
219227
},
220228
{
@@ -239,6 +247,7 @@
239247
"MetricGroup": "TopdownL1;tma_L1_group",
240248
"MetricName": "tma_frontend_bound",
241249
"MetricThreshold": "tma_frontend_bound > 0.2",
250+
"MetricgroupNoGroup": "TopdownL1",
242251
"ScaleUnit": "100%"
243252
},
244253
{
@@ -499,6 +508,7 @@
499508
"MetricGroup": "TopdownL2;tma_L2_group;tma_bad_speculation_group",
500509
"MetricName": "tma_machine_clears",
501510
"MetricThreshold": "tma_machine_clears > 0.05",
511+
"MetricgroupNoGroup": "TopdownL2",
502512
"ScaleUnit": "100%"
503513
},
504514
{
@@ -515,6 +525,7 @@
515525
"MetricGroup": "TopdownL2;tma_L2_group;tma_backend_bound_group",
516526
"MetricName": "tma_memory_bound",
517527
"MetricThreshold": "tma_memory_bound > 0.2",
528+
"MetricgroupNoGroup": "TopdownL2",
518529
"ScaleUnit": "100%"
519530
},
520531
{
@@ -531,6 +542,7 @@
531542
"MetricGroup": "TopdownL2;tma_L2_group;tma_retiring_group",
532543
"MetricName": "tma_ms_uops",
533544
"MetricThreshold": "tma_ms_uops > 0.05",
545+
"MetricgroupNoGroup": "TopdownL2",
534546
"PublicDescription": "Counts the number of uops that are from the complex flows issued by the micro-sequencer (MS). This includes uops from flows due to complex instructions, faults, assists, and inserted flows.",
535547
"ScaleUnit": "100%"
536548
},
@@ -620,6 +632,7 @@
620632
"MetricGroup": "TopdownL2;tma_L2_group;tma_backend_bound_aux_group",
621633
"MetricName": "tma_resource_bound",
622634
"MetricThreshold": "tma_resource_bound > 0.2",
635+
"MetricgroupNoGroup": "TopdownL2",
623636
"PublicDescription": "Counts the total number of issue slots that were not consumed by the backend due to backend stalls. Note that uops must be available for consumption in order for this event to count. If a uop is not available (IQ is empty), this event will not count.",
624637
"ScaleUnit": "100%"
625638
},
@@ -629,6 +642,7 @@
629642
"MetricGroup": "TopdownL1;tma_L1_group",
630643
"MetricName": "tma_retiring",
631644
"MetricThreshold": "tma_retiring > 0.75",
645+
"MetricgroupNoGroup": "TopdownL1",
632646
"ScaleUnit": "100%"
633647
},
634648
{

tools/perf/pmu-events/arch/x86/broadwell/bdw-metrics.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@
103103
"MetricGroup": "TmaL1;TopdownL1;tma_L1_group",
104104
"MetricName": "tma_backend_bound",
105105
"MetricThreshold": "tma_backend_bound > 0.2",
106+
"MetricgroupNoGroup": "TopdownL1",
106107
"PublicDescription": "This category represents fraction of slots where no uops are being delivered due to a lack of required resources for accepting new uops in the Backend. Backend is the portion of the processor core where the out-of-order scheduler dispatches ready uops into their respective execution units; and once completed these uops get retired according to program order. For example; stalls due to data-cache misses or stalls due to the divider unit being overloaded are both categorized under Backend Bound. Backend Bound is further divided into two main categories: Memory Bound and Core Bound.",
107108
"ScaleUnit": "100%"
108109
},
@@ -112,6 +113,7 @@
112113
"MetricGroup": "TmaL1;TopdownL1;tma_L1_group",
113114
"MetricName": "tma_bad_speculation",
114115
"MetricThreshold": "tma_bad_speculation > 0.15",
116+
"MetricgroupNoGroup": "TopdownL1",
115117
"PublicDescription": "This category represents fraction of slots wasted due to incorrect speculations. This include slots used to issue uops that do not eventually get retired and slots for which the issue-pipeline was blocked due to recovery from earlier incorrect speculation. For example; wasted work due to miss-predicted branches are categorized under Bad Speculation category. Incorrect data speculation followed by Memory Ordering Nukes is another example.",
116118
"ScaleUnit": "100%"
117119
},
@@ -122,6 +124,7 @@
122124
"MetricGroup": "BadSpec;BrMispredicts;TmaL2;TopdownL2;tma_L2_group;tma_bad_speculation_group;tma_issueBM",
123125
"MetricName": "tma_branch_mispredicts",
124126
"MetricThreshold": "tma_branch_mispredicts > 0.1 & tma_bad_speculation > 0.15",
127+
"MetricgroupNoGroup": "TopdownL2",
125128
"PublicDescription": "This metric represents fraction of slots the CPU has wasted due to Branch Misprediction. These slots are either wasted by uops fetched from an incorrectly speculated program path; or stalls when the out-of-order part of the machine needs to recover its state from a speculative path. Sample with: BR_MISP_RETIRED.ALL_BRANCHES. Related metrics: tma_info_branch_misprediction_cost, tma_mispredicts_resteers",
126129
"ScaleUnit": "100%"
127130
},
@@ -170,6 +173,7 @@
170173
"MetricGroup": "Backend;Compute;TmaL2;TopdownL2;tma_L2_group;tma_backend_bound_group",
171174
"MetricName": "tma_core_bound",
172175
"MetricThreshold": "tma_core_bound > 0.1 & tma_backend_bound > 0.2",
176+
"MetricgroupNoGroup": "TopdownL2",
173177
"PublicDescription": "This metric represents fraction of slots where Core non-memory issues were of a bottleneck. Shortage in hardware compute resources; or dependencies in software's instructions are both categorized under Core Bound. Hence it may indicate the machine ran out of an out-of-order resource; certain execution units are overloaded or dependencies in program's data- or instruction-flow are limiting the performance (e.g. FP-chained long-latency arithmetic operations).",
174178
"ScaleUnit": "100%"
175179
},
@@ -263,6 +267,7 @@
263267
"MetricGroup": "FetchBW;Frontend;TmaL2;TopdownL2;tma_L2_group;tma_frontend_bound_group;tma_issueFB",
264268
"MetricName": "tma_fetch_bandwidth",
265269
"MetricThreshold": "tma_fetch_bandwidth > 0.1 & tma_frontend_bound > 0.15 & tma_info_ipc / 4 > 0.35",
270+
"MetricgroupNoGroup": "TopdownL2",
266271
"PublicDescription": "This metric represents fraction of slots the CPU was stalled due to Frontend bandwidth issues. For example; inefficiencies at the instruction decoders; or restrictions for caching in the DSB (decoded uops cache) are categorized under Fetch Bandwidth. In such cases; the Frontend typically delivers suboptimal amount of uops to the Backend. Related metrics: tma_dsb_switches, tma_info_dsb_coverage, tma_info_iptb, tma_lcp",
267272
"ScaleUnit": "100%"
268273
},
@@ -272,6 +277,7 @@
272277
"MetricGroup": "Frontend;TmaL2;TopdownL2;tma_L2_group;tma_frontend_bound_group",
273278
"MetricName": "tma_fetch_latency",
274279
"MetricThreshold": "tma_fetch_latency > 0.1 & tma_frontend_bound > 0.15",
280+
"MetricgroupNoGroup": "TopdownL2",
275281
"PublicDescription": "This metric represents fraction of slots the CPU was stalled due to Frontend latency issues. For example; instruction-cache misses; iTLB misses or fetch stalls after a branch misprediction are categorized under Frontend Latency. In such cases; the Frontend eventually delivers no uops for some period. Sample with: RS_EVENTS.EMPTY_END",
276282
"ScaleUnit": "100%"
277283
},
@@ -326,6 +332,7 @@
326332
"MetricGroup": "PGO;TmaL1;TopdownL1;tma_L1_group",
327333
"MetricName": "tma_frontend_bound",
328334
"MetricThreshold": "tma_frontend_bound > 0.15",
335+
"MetricgroupNoGroup": "TopdownL1",
329336
"PublicDescription": "This category represents fraction of slots where the processor's Frontend undersupplies its Backend. Frontend denotes the first part of the processor core responsible to fetch operations that are executed later on by the Backend part. Within the Frontend; a branch predictor predicts the next address to fetch; cache-lines are fetched from the memory subsystem; parsed into instructions; and lastly decoded into micro-operations (uops). Ideally the Frontend can issue Pipeline_Width uops every cycle to the Backend. Frontend Bound denotes unutilized issue-slots when there is no Backend stall; i.e. bubbles where Frontend delivered no uops while Backend could have accepted them. For example; stalls due to instruction-cache misses would be categorized under Frontend Bound.",
330337
"ScaleUnit": "100%"
331338
},
@@ -335,6 +342,7 @@
335342
"MetricGroup": "Retire;TmaL2;TopdownL2;tma_L2_group;tma_retiring_group",
336343
"MetricName": "tma_heavy_operations",
337344
"MetricThreshold": "tma_heavy_operations > 0.1",
345+
"MetricgroupNoGroup": "TopdownL2",
338346
"PublicDescription": "This metric represents fraction of slots where the CPU was retiring heavy-weight operations -- instructions that require two or more uops or micro-coded sequences. This highly-correlates with the uop length of these instructions/sequences.",
339347
"ScaleUnit": "100%"
340348
},
@@ -828,6 +836,7 @@
828836
"MetricGroup": "Retire;TmaL2;TopdownL2;tma_L2_group;tma_retiring_group",
829837
"MetricName": "tma_light_operations",
830838
"MetricThreshold": "tma_light_operations > 0.6",
839+
"MetricgroupNoGroup": "TopdownL2",
831840
"PublicDescription": "This metric represents fraction of slots where the CPU was retiring light-weight operations -- instructions that require no more than one uop (micro-operation). This correlates with total number of instructions used by the program. A uops-per-instruction (see UopPI metric) ratio of 1 or less should be expected for decently optimized software running on Intel Core/Xeon products. While this often indicates efficient X86 instructions were executed; high value does not necessarily mean better performance cannot be achieved. Sample with: INST_RETIRED.PREC_DIST",
832841
"ScaleUnit": "100%"
833842
},
@@ -858,6 +867,7 @@
858867
"MetricGroup": "BadSpec;MachineClears;TmaL2;TopdownL2;tma_L2_group;tma_bad_speculation_group;tma_issueMC;tma_issueSyncxn",
859868
"MetricName": "tma_machine_clears",
860869
"MetricThreshold": "tma_machine_clears > 0.1 & tma_bad_speculation > 0.15",
870+
"MetricgroupNoGroup": "TopdownL2",
861871
"PublicDescription": "This metric represents fraction of slots the CPU has wasted due to Machine Clears. These slots are either wasted by uops fetched prior to the clear; or stalls the out-of-order portion of the machine needs to recover its state after the clear. For example; this can happen due to memory ordering Nukes (e.g. Memory Disambiguation) or Self-Modifying-Code (SMC) nukes. Sample with: MACHINE_CLEARS.COUNT. Related metrics: tma_clears_resteers, tma_contested_accesses, tma_data_sharing, tma_false_sharing, tma_l1_bound, tma_microcode_sequencer, tma_ms_switches, tma_remote_cache",
862872
"ScaleUnit": "100%"
863873
},
@@ -886,6 +896,7 @@
886896
"MetricGroup": "Backend;TmaL2;TopdownL2;tma_L2_group;tma_backend_bound_group",
887897
"MetricName": "tma_memory_bound",
888898
"MetricThreshold": "tma_memory_bound > 0.2 & tma_backend_bound > 0.2",
899+
"MetricgroupNoGroup": "TopdownL2",
889900
"PublicDescription": "This metric represents fraction of slots the Memory subsystem within the Backend was a bottleneck. Memory Bound estimates fraction of slots where pipeline is likely stalled due to demand load or store instructions. This accounts mainly for (1) non-completed in-flight memory demand loads which coincides with execution units starvation; in addition to (2) cases where stores could impose backpressure on the pipeline when many of them get buffered at the same time (less common out of the two).",
890901
"ScaleUnit": "100%"
891902
},
@@ -1048,6 +1059,7 @@
10481059
"MetricGroup": "TmaL1;TopdownL1;tma_L1_group",
10491060
"MetricName": "tma_retiring",
10501061
"MetricThreshold": "tma_retiring > 0.7 | tma_heavy_operations > 0.1",
1062+
"MetricgroupNoGroup": "TopdownL1",
10511063
"PublicDescription": "This category represents fraction of slots utilized by useful work i.e. issued uops that eventually get retired. Ideally; all pipeline slots would be attributed to the Retiring category. Retiring of 100% would indicate the maximum Pipeline_Width throughput was achieved. Maximizing Retiring typically increases the Instructions-per-cycle (see IPC metric). Note that a high Retiring value does not necessary mean there is no room for more performance. For example; Heavy-operations or Microcode Assists are categorized under Retiring. They often indicate suboptimal performance and can often be optimized or avoided. Sample with: UOPS_RETIRED.RETIRE_SLOTS",
10521064
"ScaleUnit": "100%"
10531065
},

0 commit comments

Comments
 (0)