File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -273,8 +273,23 @@ static const u64 amd_zen2_perfmon_event_map[PERF_COUNT_HW_MAX] =
273
273
[PERF_COUNT_HW_STALLED_CYCLES_FRONTEND ] = 0x00a9 ,
274
274
};
275
275
276
+ static const u64 amd_zen4_perfmon_event_map [PERF_COUNT_HW_MAX ] =
277
+ {
278
+ [PERF_COUNT_HW_CPU_CYCLES ] = 0x0076 ,
279
+ [PERF_COUNT_HW_INSTRUCTIONS ] = 0x00c0 ,
280
+ [PERF_COUNT_HW_CACHE_REFERENCES ] = 0xff60 ,
281
+ [PERF_COUNT_HW_CACHE_MISSES ] = 0x0964 ,
282
+ [PERF_COUNT_HW_BRANCH_INSTRUCTIONS ] = 0x00c2 ,
283
+ [PERF_COUNT_HW_BRANCH_MISSES ] = 0x00c3 ,
284
+ [PERF_COUNT_HW_STALLED_CYCLES_FRONTEND ] = 0x00a9 ,
285
+ [PERF_COUNT_HW_REF_CPU_CYCLES ] = 0x100000120 ,
286
+ };
287
+
276
288
static u64 amd_pmu_event_map (int hw_event )
277
289
{
290
+ if (cpu_feature_enabled (X86_FEATURE_ZEN4 ) || boot_cpu_data .x86 >= 0x1a )
291
+ return amd_zen4_perfmon_event_map [hw_event ];
292
+
278
293
if (cpu_feature_enabled (X86_FEATURE_ZEN2 ) || boot_cpu_data .x86 >= 0x19 )
279
294
return amd_zen2_perfmon_event_map [hw_event ];
280
295
You can’t perform that action at this time.
0 commit comments