From: Namhyung Kim Date: Mon, 24 Sep 2012 08:15:02 +0000 (+0900) Subject: perf kvm: Use perf_session_env for reading cpuid X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=2f9e97aa8b4c6220c0770a966fb99d7366679813;p=linux-beck.git perf kvm: Use perf_session_env for reading cpuid We have processed and saved cpuid information to perf_session_env so reuse it for get_cpu_isa(). Signed-off-by: Namhyung Kim Cc: David Ahern Cc: Dong Hao Cc: Ingo Molnar Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Stephane Eranian Cc: Xiao Guangrong Link: http://lkml.kernel.org/r/1348474503-15070-6-git-send-email-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/perf/builtin-kvm.c b/tools/perf/builtin-kvm.c index 3eb53e33c02b..a28c9cad9048 100644 --- a/tools/perf/builtin-kvm.c +++ b/tools/perf/builtin-kvm.c @@ -664,16 +664,9 @@ static struct perf_tool eops = { static int get_cpu_isa(struct perf_session *session) { - char *cpuid; + char *cpuid = session->header.env.cpuid; int isa; - cpuid = perf_header__read_feature(session, HEADER_CPUID); - - if (!cpuid) { - pr_err("read HEADER_CPUID failed.\n"); - return -ENOTSUP; - } - if (strstr(cpuid, "Intel")) isa = 1; else if (strstr(cpuid, "AMD")) @@ -683,7 +676,6 @@ static int get_cpu_isa(struct perf_session *session) isa = -ENOTSUP; } - free(cpuid); return isa; }