diff options
author | Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com> | 2012-11-19 03:19:21 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2012-11-23 18:40:17 -0500 |
commit | 7321090f6751c9987c26a8c81c63680d16a614d7 (patch) | |
tree | 27a52ff8c74ec62f604f72e68255df884ec5c112 /tools/perf | |
parent | 3786063a3c0ba26a2400a04476c0c0ccfd3c6beb (diff) |
perf kvm: Fix building perf kvm on non x86 arches
Now, 'perf kvm stat' is only supported on x86, let its code depend on
(__x86_64__ || __i386__) to fix building it on other architectures.
Reviewed-by: David Howells <dhowells@redhat.com>
Signed-off-by: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: David Ahern <dsahern@gmail.com>
Cc: David Howells <dhowells@redhat.com>
Cc: Dong Hao <haodong@linux.vnet.ibm.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Josh Boyer <jwboyer@gmail.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Namhyung Kim <namhyung@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Runzhen Wang <runzhen@linux.vnet.ibm.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-arch@vger.kernel.org
Cc: x86@kernel.org
Link: http://lkml.kernel.org/r/50A9EB89.70901@linux.vnet.ibm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf')
-rw-r--r-- | tools/perf/builtin-kvm.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/perf/builtin-kvm.c b/tools/perf/builtin-kvm.c index 9fa45fa13bd6..283b4397e397 100644 --- a/tools/perf/builtin-kvm.c +++ b/tools/perf/builtin-kvm.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <pthread.h> | 22 | #include <pthread.h> |
23 | #include <math.h> | 23 | #include <math.h> |
24 | 24 | ||
25 | #if defined(__i386__) || defined(__x86_64__) | ||
25 | #include <asm/svm.h> | 26 | #include <asm/svm.h> |
26 | #include <asm/vmx.h> | 27 | #include <asm/vmx.h> |
27 | #include <asm/kvm.h> | 28 | #include <asm/kvm.h> |
@@ -896,6 +897,7 @@ static int kvm_cmd_stat(const char *file_name, int argc, const char **argv) | |||
896 | perf_stat: | 897 | perf_stat: |
897 | return cmd_stat(argc, argv, NULL); | 898 | return cmd_stat(argc, argv, NULL); |
898 | } | 899 | } |
900 | #endif | ||
899 | 901 | ||
900 | static int __cmd_record(const char *file_name, int argc, const char **argv) | 902 | static int __cmd_record(const char *file_name, int argc, const char **argv) |
901 | { | 903 | { |
@@ -1018,8 +1020,10 @@ int cmd_kvm(int argc, const char **argv, const char *prefix __maybe_unused) | |||
1018 | return cmd_top(argc, argv, NULL); | 1020 | return cmd_top(argc, argv, NULL); |
1019 | else if (!strncmp(argv[0], "buildid-list", 12)) | 1021 | else if (!strncmp(argv[0], "buildid-list", 12)) |
1020 | return __cmd_buildid_list(file_name, argc, argv); | 1022 | return __cmd_buildid_list(file_name, argc, argv); |
1023 | #if defined(__i386__) || defined(__x86_64__) | ||
1021 | else if (!strncmp(argv[0], "stat", 4)) | 1024 | else if (!strncmp(argv[0], "stat", 4)) |
1022 | return kvm_cmd_stat(file_name, argc, argv); | 1025 | return kvm_cmd_stat(file_name, argc, argv); |
1026 | #endif | ||
1023 | else | 1027 | else |
1024 | usage_with_options(kvm_usage, kvm_options); | 1028 | usage_with_options(kvm_usage, kvm_options); |
1025 | 1029 | ||