Commit a22e99cd authored by Jiri Olsa's avatar Jiri Olsa Committed by Arnaldo Carvalho de Melo

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: default avatarJiri 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.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 578e91ec
...@@ -141,16 +141,6 @@ static inline void diff_timespec(struct timespec *r, struct timespec *a, ...@@ -141,16 +141,6 @@ static inline void diff_timespec(struct timespec *r, struct timespec *a,
} }
} }
static inline struct cpu_map *perf_evsel__cpus(struct perf_evsel *evsel)
{
return (evsel->cpus && !target.cpu_list) ? evsel->cpus : evsel_list->cpus;
}
static inline int perf_evsel__nr_cpus(struct perf_evsel *evsel)
{
return perf_evsel__cpus(evsel)->nr;
}
static void perf_evsel__reset_stat_priv(struct perf_evsel *evsel) static void perf_evsel__reset_stat_priv(struct perf_evsel *evsel)
{ {
int i; int i;
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include <linux/types.h> #include <linux/types.h>
#include "xyarray.h" #include "xyarray.h"
#include "symbol.h" #include "symbol.h"
#include "cpumap.h"
struct perf_counts_values { struct perf_counts_values {
union { union {
...@@ -114,6 +115,16 @@ struct thread_map; ...@@ -114,6 +115,16 @@ struct thread_map;
struct perf_evlist; struct perf_evlist;
struct record_opts; struct record_opts;
static inline struct cpu_map *perf_evsel__cpus(struct perf_evsel *evsel)
{
return evsel->cpus;
}
static inline int perf_evsel__nr_cpus(struct perf_evsel *evsel)
{
return perf_evsel__cpus(evsel)->nr;
}
void perf_counts_values__scale(struct perf_counts_values *count, void perf_counts_values__scale(struct perf_counts_values *count,
bool scale, s8 *pscaled); bool scale, s8 *pscaled);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment