Skip to content

Commit

Permalink
perf kvm: Use perf_session_env for reading cpuid
Browse files Browse the repository at this point in the history
We have processed and saved cpuid information to perf_session_env so
reuse it for get_cpu_isa().

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Dong Hao <haodong@linux.vnet.ibm.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Stephane Eranian <eranian@google.com>
Cc: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
Link: http://lkml.kernel.org/r/1348474503-15070-6-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
  • Loading branch information
Namhyung Kim authored and Arnaldo Carvalho de Melo committed Sep 24, 2012
1 parent 3d7eb86 commit 2f9e97a
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions tools/perf/builtin-kvm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand All @@ -683,7 +676,6 @@ static int get_cpu_isa(struct perf_session *session)
isa = -ENOTSUP;
}

free(cpuid);
return isa;
}

Expand Down

0 comments on commit 2f9e97a

Please sign in to comment.