OSDN Git Service

perf tools: Add Hygon Dhyana support
authorPu Wen <puwen@hygon.cn>
Mon, 12 Nov 2018 07:40:51 +0000 (15:40 +0800)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 22 Nov 2018 01:39:56 +0000 (22:39 -0300)
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 <puwen@hygon.cn>
Acked-by: Borislav Petkov <bp@suse.de>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1542008451-31735-1-git-send-email-puwen@hygon.cn
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/arch/x86/util/kvm-stat.c

index b32409a..081353d 100644 (file)
@@ -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