提交 7321090f 编写于 作者: X Xiao Guangrong 提交者: Arnaldo Carvalho de Melo

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: NDavid Howells <dhowells@redhat.com>
Signed-off-by: NXiao 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.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
上级 3786063a
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include <pthread.h> #include <pthread.h>
#include <math.h> #include <math.h>
#if defined(__i386__) || defined(__x86_64__)
#include <asm/svm.h> #include <asm/svm.h>
#include <asm/vmx.h> #include <asm/vmx.h>
#include <asm/kvm.h> #include <asm/kvm.h>
...@@ -896,6 +897,7 @@ static int kvm_cmd_stat(const char *file_name, int argc, const char **argv) ...@@ -896,6 +897,7 @@ static int kvm_cmd_stat(const char *file_name, int argc, const char **argv)
perf_stat: perf_stat:
return cmd_stat(argc, argv, NULL); return cmd_stat(argc, argv, NULL);
} }
#endif
static int __cmd_record(const char *file_name, int argc, const char **argv) static int __cmd_record(const char *file_name, int argc, const char **argv)
{ {
...@@ -1018,8 +1020,10 @@ int cmd_kvm(int argc, const char **argv, const char *prefix __maybe_unused) ...@@ -1018,8 +1020,10 @@ int cmd_kvm(int argc, const char **argv, const char *prefix __maybe_unused)
return cmd_top(argc, argv, NULL); return cmd_top(argc, argv, NULL);
else if (!strncmp(argv[0], "buildid-list", 12)) else if (!strncmp(argv[0], "buildid-list", 12))
return __cmd_buildid_list(file_name, argc, argv); return __cmd_buildid_list(file_name, argc, argv);
#if defined(__i386__) || defined(__x86_64__)
else if (!strncmp(argv[0], "stat", 4)) else if (!strncmp(argv[0], "stat", 4))
return kvm_cmd_stat(file_name, argc, argv); return kvm_cmd_stat(file_name, argc, argv);
#endif
else else
usage_with_options(kvm_usage, kvm_options); usage_with_options(kvm_usage, kvm_options);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册