[tip:perf/core] perf kvm: Use perf_session_env for reading cpuid

From: tip-bot for Namhyung Kim
Date: Thu Sep 27 2012 - 01:33:57 EST


Commit-ID: 2f9e97aa8b4c6220c0770a966fb99d7366679813
Gitweb: http://git.kernel.org/tip/2f9e97aa8b4c6220c0770a966fb99d7366679813
Author: Namhyung Kim <namhyung.kim@xxxxxxx>
AuthorDate: Mon, 24 Sep 2012 17:15:02 +0900
Committer: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
CommitDate: Mon, 24 Sep 2012 11:47:27 -0300

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 <namhyung@xxxxxxxxxx>
Cc: David Ahern <dsahern@xxxxxxxxx>
Cc: Dong Hao <haodong@xxxxxxxxxxxxxxxxxx>
Cc: Ingo Molnar <mingo@xxxxxxxxxx>
Cc: Paul Mackerras <paulus@xxxxxxxxx>
Cc: Peter Zijlstra <a.p.zijlstra@xxxxxxxxx>
Cc: Stephane Eranian <eranian@xxxxxxxxxx>
Cc: Xiao Guangrong <xiaoguangrong@xxxxxxxxxxxxxxxxxx>
Link: http://lkml.kernel.org/r/1348474503-15070-6-git-send-email-namhyung@xxxxxxxxxx
Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
---
tools/perf/builtin-kvm.c | 10 +---------
1 files changed, 1 insertions(+), 9 deletions(-)

diff --git a/tools/perf/builtin-kvm.c b/tools/perf/builtin-kvm.c
index 3eb53e3..a28c9ca 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;
}

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/