diff options
author | Namhyung Kim <namhyung.kim@lge.com> | 2012-09-24 04:15:02 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2012-09-24 10:47:27 -0400 |
commit | 2f9e97aa8b4c6220c0770a966fb99d7366679813 (patch) | |
tree | 9290ce9a6c7ceb7fc1c84b969a27643abbf73fbd /tools/perf/builtin-kvm.c | |
parent | 3d7eb86b9d84e7493c8c835fbcd2a3fe4a1f5937 (diff) |
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@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>
Diffstat (limited to 'tools/perf/builtin-kvm.c')
-rw-r--r-- | 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 3eb53e33c02b..a28c9cad9048 100644 --- a/tools/perf/builtin-kvm.c +++ b/tools/perf/builtin-kvm.c | |||
@@ -664,16 +664,9 @@ static struct perf_tool eops = { | |||
664 | 664 | ||
665 | static int get_cpu_isa(struct perf_session *session) | 665 | static int get_cpu_isa(struct perf_session *session) |
666 | { | 666 | { |
667 | char *cpuid; | 667 | char *cpuid = session->header.env.cpuid; |
668 | int isa; | 668 | int isa; |
669 | 669 | ||
670 | cpuid = perf_header__read_feature(session, HEADER_CPUID); | ||
671 | |||
672 | if (!cpuid) { | ||
673 | pr_err("read HEADER_CPUID failed.\n"); | ||
674 | return -ENOTSUP; | ||
675 | } | ||
676 | |||
677 | if (strstr(cpuid, "Intel")) | 670 | if (strstr(cpuid, "Intel")) |
678 | isa = 1; | 671 | isa = 1; |
679 | else if (strstr(cpuid, "AMD")) | 672 | else if (strstr(cpuid, "AMD")) |
@@ -683,7 +676,6 @@ static int get_cpu_isa(struct perf_session *session) | |||
683 | isa = -ENOTSUP; | 676 | isa = -ENOTSUP; |
684 | } | 677 | } |
685 | 678 | ||
686 | free(cpuid); | ||
687 | return isa; | 679 | return isa; |
688 | } | 680 | } |
689 | 681 | ||