lkml.org 
[lkml]   [2012]   [Sep]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 5/6] perf kvm: Use perf_session_env for reading cpuid
Date
From: Namhyung Kim <namhyung.kim@lge.com>

We have processed and saved cpuid information to perf_session_env
so reuse it for get_cpu_isa().

Cc: David Ahern <dsahern@gmail.com>
Cc: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
Cc: Dong Hao <haodong@linux.vnet.ibm.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
tools/perf/builtin-kvm.c | 10 +---------
1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/tools/perf/builtin-kvm.c b/tools/perf/builtin-kvm.c
index 819af25a9a11..b76b3aa14ffd 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;
}

--
1.7.11.4


\
 
 \ /
  Last update: 2012-09-24 11:01    [W:0.077 / U:1.596 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site