Skip to content

Commit 8d40f74

Browse files
sandip4nacmel
authored andcommitted
perf vendor events amd: Fix large metrics
There are cases where a metric requires more events than the number of available counters. E.g. AMD Zen, Zen 2 and Zen 3 processors have four data fabric counters but the "nps1_die_to_dram" metric has eight events. By default, the constituent events are placed in a group and since the events cannot be scheduled at the same time, the metric is not computed. The "all metrics" test also fails because of this. Use the NO_GROUP_EVENTS constraint for such metrics which anyway expect the user to run perf with "--metric-no-group". E.g. $ sudo perf test -v 101 Before: 101: perf all metrics test : --- start --- test child forked, pid 37131 Testing branch_misprediction_ratio Testing all_remote_links_outbound Testing nps1_die_to_dram Metric 'nps1_die_to_dram' not printed in: Error: Invalid event (dram_channel_data_controller_4) in per-thread mode, enable system wide with '-a'. Testing macro_ops_dispatched Testing all_l2_cache_accesses Testing all_l2_cache_hits Testing all_l2_cache_misses Testing ic_fetch_miss_ratio Testing l2_cache_accesses_from_l2_hwpf Testing l2_cache_misses_from_l2_hwpf Testing op_cache_fetch_miss_ratio Testing l3_read_miss_latency Testing l1_itlb_misses test child finished with -1 ---- end ---- perf all metrics test: FAILED! After: 101: perf all metrics test : --- start --- test child forked, pid 43766 Testing branch_misprediction_ratio Testing all_remote_links_outbound Testing nps1_die_to_dram Testing macro_ops_dispatched Testing all_l2_cache_accesses Testing all_l2_cache_hits Testing all_l2_cache_misses Testing ic_fetch_miss_ratio Testing l2_cache_accesses_from_l2_hwpf Testing l2_cache_misses_from_l2_hwpf Testing op_cache_fetch_miss_ratio Testing l3_read_miss_latency Testing l1_itlb_misses test child finished with 0 ---- end ---- perf all metrics test: Ok Reported-by: Ayush Jain <[email protected]> Suggested-by: Ian Rogers <[email protected]> Signed-off-by: Sandipan Das <[email protected]> Acked-by: Ian Rogers <[email protected]> Cc: Adrian Hunter <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Ananth Narayan <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Ravi Bangoria <[email protected]> Cc: Santosh Shukla <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent 1feece2 commit 8d40f74

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

tools/perf/pmu-events/arch/x86/amdzen1/recommended.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,9 @@
169169
},
170170
{
171171
"MetricName": "nps1_die_to_dram",
172-
"BriefDescription": "Approximate: Combined DRAM B/bytes of all channels on a NPS1 node (die) (may need --metric-no-group)",
172+
"BriefDescription": "Approximate: Combined DRAM B/bytes of all channels on a NPS1 node (die)",
173173
"MetricExpr": "dram_channel_data_controller_0 + dram_channel_data_controller_1 + dram_channel_data_controller_2 + dram_channel_data_controller_3 + dram_channel_data_controller_4 + dram_channel_data_controller_5 + dram_channel_data_controller_6 + dram_channel_data_controller_7",
174+
"MetricConstraint": "NO_GROUP_EVENTS",
174175
"MetricGroup": "data_fabric",
175176
"PerPkg": "1",
176177
"ScaleUnit": "6.1e-5MiB"

tools/perf/pmu-events/arch/x86/amdzen2/recommended.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,9 @@
169169
},
170170
{
171171
"MetricName": "nps1_die_to_dram",
172-
"BriefDescription": "Approximate: Combined DRAM B/bytes of all channels on a NPS1 node (die) (may need --metric-no-group)",
172+
"BriefDescription": "Approximate: Combined DRAM B/bytes of all channels on a NPS1 node (die)",
173173
"MetricExpr": "dram_channel_data_controller_0 + dram_channel_data_controller_1 + dram_channel_data_controller_2 + dram_channel_data_controller_3 + dram_channel_data_controller_4 + dram_channel_data_controller_5 + dram_channel_data_controller_6 + dram_channel_data_controller_7",
174+
"MetricConstraint": "NO_GROUP_EVENTS",
174175
"MetricGroup": "data_fabric",
175176
"PerPkg": "1",
176177
"ScaleUnit": "6.1e-5MiB"

tools/perf/pmu-events/arch/x86/amdzen3/recommended.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,10 +205,11 @@
205205
},
206206
{
207207
"MetricName": "nps1_die_to_dram",
208-
"BriefDescription": "Approximate: Combined DRAM B/bytes of all channels on a NPS1 node (die) (may need --metric-no-group)",
208+
"BriefDescription": "Approximate: Combined DRAM B/bytes of all channels on a NPS1 node (die)",
209209
"MetricExpr": "dram_channel_data_controller_0 + dram_channel_data_controller_1 + dram_channel_data_controller_2 + dram_channel_data_controller_3 + dram_channel_data_controller_4 + dram_channel_data_controller_5 + dram_channel_data_controller_6 + dram_channel_data_controller_7",
210210
"MetricGroup": "data_fabric",
211211
"PerPkg": "1",
212+
"MetricConstraint": "NO_GROUP_EVENTS",
212213
"ScaleUnit": "6.1e-5MiB"
213214
}
214215
]

0 commit comments

Comments
 (0)