diff options
| -rw-r--r-- | tools/perf/arch/x86/Makefile | 1 | ||||
| -rw-r--r-- | tools/perf/builtin-kvm.c | 6 | ||||
| -rw-r--r-- | tools/perf/config/Makefile | 4 |
3 files changed, 8 insertions, 3 deletions
diff --git a/tools/perf/arch/x86/Makefile b/tools/perf/arch/x86/Makefile index 1641542e3636..d3939014a877 100644 --- a/tools/perf/arch/x86/Makefile +++ b/tools/perf/arch/x86/Makefile | |||
| @@ -15,3 +15,4 @@ endif | |||
| 15 | LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/header.o | 15 | LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/header.o |
| 16 | LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/tsc.o | 16 | LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/tsc.o |
| 17 | LIB_H += arch/$(ARCH)/util/tsc.h | 17 | LIB_H += arch/$(ARCH)/util/tsc.h |
| 18 | HAVE_KVM_STAT_SUPPORT := 1 | ||
diff --git a/tools/perf/builtin-kvm.c b/tools/perf/builtin-kvm.c index 0f1e5a2f6ad7..214ec0e7492b 100644 --- a/tools/perf/builtin-kvm.c +++ b/tools/perf/builtin-kvm.c | |||
| @@ -29,7 +29,7 @@ | |||
| 29 | #include <pthread.h> | 29 | #include <pthread.h> |
| 30 | #include <math.h> | 30 | #include <math.h> |
| 31 | 31 | ||
| 32 | #if defined(__i386__) || defined(__x86_64__) | 32 | #ifdef HAVE_KVM_STAT_SUPPORT |
| 33 | #include <asm/svm.h> | 33 | #include <asm/svm.h> |
| 34 | #include <asm/vmx.h> | 34 | #include <asm/vmx.h> |
| 35 | #include <asm/kvm.h> | 35 | #include <asm/kvm.h> |
| @@ -1609,7 +1609,7 @@ static int kvm_cmd_stat(const char *file_name, int argc, const char **argv) | |||
| 1609 | perf_stat: | 1609 | perf_stat: |
| 1610 | return cmd_stat(argc, argv, NULL); | 1610 | return cmd_stat(argc, argv, NULL); |
| 1611 | } | 1611 | } |
| 1612 | #endif | 1612 | #endif /* HAVE_KVM_STAT_SUPPORT */ |
| 1613 | 1613 | ||
| 1614 | static int __cmd_record(const char *file_name, int argc, const char **argv) | 1614 | static int __cmd_record(const char *file_name, int argc, const char **argv) |
| 1615 | { | 1615 | { |
| @@ -1726,7 +1726,7 @@ int cmd_kvm(int argc, const char **argv, const char *prefix __maybe_unused) | |||
| 1726 | return cmd_top(argc, argv, NULL); | 1726 | return cmd_top(argc, argv, NULL); |
| 1727 | else if (!strncmp(argv[0], "buildid-list", 12)) | 1727 | else if (!strncmp(argv[0], "buildid-list", 12)) |
| 1728 | return __cmd_buildid_list(file_name, argc, argv); | 1728 | return __cmd_buildid_list(file_name, argc, argv); |
| 1729 | #if defined(__i386__) || defined(__x86_64__) | 1729 | #ifdef HAVE_KVM_STAT_SUPPORT |
| 1730 | else if (!strncmp(argv[0], "stat", 4)) | 1730 | else if (!strncmp(argv[0], "stat", 4)) |
| 1731 | return kvm_cmd_stat(file_name, argc, argv); | 1731 | return kvm_cmd_stat(file_name, argc, argv); |
| 1732 | #endif | 1732 | #endif |
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile index 346bdb617544..b7f42d577c4e 100644 --- a/tools/perf/config/Makefile +++ b/tools/perf/config/Makefile | |||
| @@ -594,6 +594,10 @@ ifndef NO_LIBNUMA | |||
| 594 | endif | 594 | endif |
| 595 | endif | 595 | endif |
| 596 | 596 | ||
| 597 | ifdef HAVE_KVM_STAT_SUPPORT | ||
| 598 | CFLAGS += -DHAVE_KVM_STAT_SUPPORT | ||
| 599 | endif | ||
| 600 | |||
| 597 | # Among the variables below, these: | 601 | # Among the variables below, these: |
| 598 | # perfexecdir | 602 | # perfexecdir |
| 599 | # template_dir | 603 | # template_dir |
