diff options
author | Jiri Olsa <jolsa@kernel.org> | 2015-06-22 18:36:08 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2015-06-25 16:15:39 -0400 |
commit | a22e99cd74a31dee4b5241bd60a256c629c808da (patch) | |
tree | be50fee90dee70a6d8fc5d9c5670b8a79932875c /tools/perf | |
parent | 578e91ec04d03aca89e300151addb3e3ed5b06ea (diff) |
perf tools: Make perf_evsel__(nr_)cpus generic
Because we now propagate all evlist's cpu_maps and thread_map objects
through all evsels, the perf_evsel__(nr_)cpus no longer need to be
specific to stat object and check evlist and target objects.
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1435012588-9007-8-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf')
-rw-r--r-- | tools/perf/builtin-stat.c | 10 | ||||
-rw-r--r-- | tools/perf/util/evsel.h | 11 |
2 files changed, 11 insertions, 10 deletions
diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index fcf99bdeb19e..3e1636cae76b 100644 --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c | |||
@@ -141,16 +141,6 @@ static inline void diff_timespec(struct timespec *r, struct timespec *a, | |||
141 | } | 141 | } |
142 | } | 142 | } |
143 | 143 | ||
144 | static inline struct cpu_map *perf_evsel__cpus(struct perf_evsel *evsel) | ||
145 | { | ||
146 | return (evsel->cpus && !target.cpu_list) ? evsel->cpus : evsel_list->cpus; | ||
147 | } | ||
148 | |||
149 | static inline int perf_evsel__nr_cpus(struct perf_evsel *evsel) | ||
150 | { | ||
151 | return perf_evsel__cpus(evsel)->nr; | ||
152 | } | ||
153 | |||
154 | static void perf_evsel__reset_stat_priv(struct perf_evsel *evsel) | 144 | static void perf_evsel__reset_stat_priv(struct perf_evsel *evsel) |
155 | { | 145 | { |
156 | int i; | 146 | int i; |
diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h index 9e16a5c4eb01..4dbf32d94dfb 100644 --- a/tools/perf/util/evsel.h +++ b/tools/perf/util/evsel.h | |||
@@ -8,6 +8,7 @@ | |||
8 | #include <linux/types.h> | 8 | #include <linux/types.h> |
9 | #include "xyarray.h" | 9 | #include "xyarray.h" |
10 | #include "symbol.h" | 10 | #include "symbol.h" |
11 | #include "cpumap.h" | ||
11 | 12 | ||
12 | struct perf_counts_values { | 13 | struct perf_counts_values { |
13 | union { | 14 | union { |
@@ -114,6 +115,16 @@ struct thread_map; | |||
114 | struct perf_evlist; | 115 | struct perf_evlist; |
115 | struct record_opts; | 116 | struct record_opts; |
116 | 117 | ||
118 | static inline struct cpu_map *perf_evsel__cpus(struct perf_evsel *evsel) | ||
119 | { | ||
120 | return evsel->cpus; | ||
121 | } | ||
122 | |||
123 | static inline int perf_evsel__nr_cpus(struct perf_evsel *evsel) | ||
124 | { | ||
125 | return perf_evsel__cpus(evsel)->nr; | ||
126 | } | ||
127 | |||
117 | void perf_counts_values__scale(struct perf_counts_values *count, | 128 | void perf_counts_values__scale(struct perf_counts_values *count, |
118 | bool scale, s8 *pscaled); | 129 | bool scale, s8 *pscaled); |
119 | 130 | ||