From: Pu Wen <pu...@hygon.cn>

The tool perf is useful for the performance analysis on the Hygon Dhyana
platform. But right now there is no Hygon support for it to analyze the
KVM guest os data. So add Hygon Dhyana support to it by checking vendor
string to share the code path of AMD.

Signed-off-by: Pu Wen <pu...@hygon.cn>
Acked-by: Borislav Petkov <b...@suse.de>
Cc: Alexander Shishkin <alexander.shish...@linux.intel.com>
Cc: Jiri Olsa <jo...@kernel.org>
Cc: Namhyung Kim <namhy...@kernel.org>
Cc: Peter Zijlstra <pet...@infradead.org>
Cc: Thomas Gleixner <t...@linutronix.de>
Link: http://lkml.kernel.org/r/1542008451-31735-1-git-send-email-pu...@hygon.cn
Signed-off-by: Arnaldo Carvalho de Melo <a...@redhat.com>
---
 tools/perf/arch/x86/util/kvm-stat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/arch/x86/util/kvm-stat.c 
b/tools/perf/arch/x86/util/kvm-stat.c
index b32409a0e546..081353d7b095 100644
--- a/tools/perf/arch/x86/util/kvm-stat.c
+++ b/tools/perf/arch/x86/util/kvm-stat.c
@@ -156,7 +156,7 @@ int cpu_isa_init(struct perf_kvm_stat *kvm, const char 
*cpuid)
        if (strstr(cpuid, "Intel")) {
                kvm->exit_reasons = vmx_exit_reasons;
                kvm->exit_reasons_isa = "VMX";
-       } else if (strstr(cpuid, "AMD")) {
+       } else if (strstr(cpuid, "AMD") || strstr(cpuid, "Hygon")) {
                kvm->exit_reasons = svm_exit_reasons;
                kvm->exit_reasons_isa = "SVM";
        } else
-- 
2.14.5

Reply via email to