diff options
author | Anju T Sudhakar <anju@linux.vnet.ibm.com> | 2019-07-18 14:17:47 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2019-09-20 09:28:26 -0400 |
commit | 8067b3da970baa12e6045400fdf009673b8dd3c2 (patch) | |
tree | 9d1ed0e3d1ff91e39b2364a3b36a020b86dae803 | |
parent | ce095c9ac293d1683f9fedb214811727dff0d508 (diff) |
perf kvm: Move kvm-stat header file from conditional inclusion to common include section
Move kvm-stat header file to the common include section, and make the
definitions in the header file under the conditional inclusion `#ifdef
HAVE_KVM_STAT_SUPPORT`.
This helps to define other 'perf kvm' related function prototypes in
kvm-stat header file, which may not need kvm-stat support.
Signed-off-by: Anju T Sudhakar <anju@linux.vnet.ibm.com>
Reviewed-By: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Madhavan Srinivasan <maddy@linux.vnet.ibm.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: linuxppc-dev@lists.ozlabs.org
Link: http://lore.kernel.org/lkml/20190718181749.30612-1-anju@linux.vnet.ibm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r-- | tools/perf/builtin-kvm.c | 2 | ||||
-rw-r--r-- | tools/perf/util/kvm-stat.h | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/tools/perf/builtin-kvm.c b/tools/perf/builtin-kvm.c index ac6d6e061dc5..2b822be87673 100644 --- a/tools/perf/builtin-kvm.c +++ b/tools/perf/builtin-kvm.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include "util/top.h" | 21 | #include "util/top.h" |
22 | #include "util/data.h" | 22 | #include "util/data.h" |
23 | #include "util/ordered-events.h" | 23 | #include "util/ordered-events.h" |
24 | #include "util/kvm-stat.h" | ||
24 | #include "ui/ui.h" | 25 | #include "ui/ui.h" |
25 | 26 | ||
26 | #include <sys/prctl.h> | 27 | #include <sys/prctl.h> |
@@ -59,7 +60,6 @@ static const char *get_filename_for_perf_kvm(void) | |||
59 | } | 60 | } |
60 | 61 | ||
61 | #ifdef HAVE_KVM_STAT_SUPPORT | 62 | #ifdef HAVE_KVM_STAT_SUPPORT |
62 | #include "util/kvm-stat.h" | ||
63 | 63 | ||
64 | void exit_event_get_key(struct evsel *evsel, | 64 | void exit_event_get_key(struct evsel *evsel, |
65 | struct perf_sample *sample, | 65 | struct perf_sample *sample, |
diff --git a/tools/perf/util/kvm-stat.h b/tools/perf/util/kvm-stat.h index 46913637085b..8fd6ec20662c 100644 --- a/tools/perf/util/kvm-stat.h +++ b/tools/perf/util/kvm-stat.h | |||
@@ -2,6 +2,8 @@ | |||
2 | #ifndef __PERF_KVM_STAT_H | 2 | #ifndef __PERF_KVM_STAT_H |
3 | #define __PERF_KVM_STAT_H | 3 | #define __PERF_KVM_STAT_H |
4 | 4 | ||
5 | #ifdef HAVE_KVM_STAT_SUPPORT | ||
6 | |||
5 | #include "tool.h" | 7 | #include "tool.h" |
6 | #include "stat.h" | 8 | #include "stat.h" |
7 | #include "record.h" | 9 | #include "record.h" |
@@ -144,5 +146,6 @@ extern const int decode_str_len; | |||
144 | extern const char *kvm_exit_reason; | 146 | extern const char *kvm_exit_reason; |
145 | extern const char *kvm_entry_trace; | 147 | extern const char *kvm_entry_trace; |
146 | extern const char *kvm_exit_trace; | 148 | extern const char *kvm_exit_trace; |
149 | #endif /* HAVE_KVM_STAT_SUPPORT */ | ||
147 | 150 | ||
148 | #endif /* __PERF_KVM_STAT_H */ | 151 | #endif /* __PERF_KVM_STAT_H */ |