Unverified Commit 56e0de56 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!14939 Fix the performance monitor relates to core for Hygon family 18h processor

Merge Pull Request from: @hygon_fanwh 
 
The commit a9843ce6 ("perf/x86/amd/core: Update and fix stalled-cycles-* events for Zen 2 and later") has modified the origin event_map to take effect on processors that has the X86_FEATURE_ZEN1 feature, This makes some event counters such as cache-misses andcache-references can not be tracked on Hygon family 18h processors. 
 
Link:https://gitee.com/openeuler/kernel/pulls/14939

 

Reviewed-by: default avatarXie XiuQi <xiexiuqi@huawei.com>
Signed-off-by: default avatarZhang Peng <zhangpeng362@huawei.com>
parents e835a628 3a33ea90
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -296,6 +296,9 @@ static u64 amd_pmu_event_map(int hw_event)
	if (cpu_feature_enabled(X86_FEATURE_ZEN1))
		return amd_zen1_perfmon_event_map[hw_event];

	if (boot_cpu_data.x86_vendor == X86_VENDOR_HYGON)
		return amd_zen1_perfmon_event_map[hw_event];

	return amd_perfmon_event_map[hw_event];
}