summaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-stat.c
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@kernel.org>2015-06-26 11:29:16 +0200
committerArnaldo Carvalho de Melo <acme@redhat.com>2015-06-26 11:44:37 -0300
commit24e34f68e21a47a582b3cc2eccdb835b80b1830a (patch)
tree967dd4dc1fc15494b29f4c6ae1bf8b1de70187d4 /tools/perf/builtin-stat.c
parenta939512d10a5583a32ae85c1bff6c4ae63a8a517 (diff)
downloadtalos-op-linux-24e34f68e21a47a582b3cc2eccdb835b80b1830a.tar.gz
talos-op-linux-24e34f68e21a47a582b3cc2eccdb835b80b1830a.zip
perf stat: Move perf_evlist__(alloc|free|reset)_stats into stat object
Moving perf_evlist__(alloc|free|reset)_stats into stat object, so it could be used in following patches. 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/1435310967-14570-12-git-send-email-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-stat.c')
-rw-r--r--tools/perf/builtin-stat.c42
1 files changed, 0 insertions, 42 deletions
diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index 0ccba5c6b61d..3e385f9f12ee 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -141,48 +141,6 @@ static inline void diff_timespec(struct timespec *r, struct timespec *a,
}
}
-static void perf_evlist__free_stats(struct perf_evlist *evlist)
-{
- struct perf_evsel *evsel;
-
- evlist__for_each(evlist, evsel) {
- perf_evsel__free_stat_priv(evsel);
- perf_evsel__free_counts(evsel);
- perf_evsel__free_prev_raw_counts(evsel);
- }
-}
-
-static int perf_evlist__alloc_stats(struct perf_evlist *evlist, bool alloc_raw)
-{
- struct perf_evsel *evsel;
- int nthreads = thread_map__nr(evsel_list->threads);
-
- evlist__for_each(evlist, evsel) {
- int ncpus = perf_evsel__nr_cpus(evsel);
-
- if (perf_evsel__alloc_stat_priv(evsel) < 0 ||
- perf_evsel__alloc_counts(evsel, ncpus, nthreads) < 0 ||
- (alloc_raw && perf_evsel__alloc_prev_raw_counts(evsel, ncpus, nthreads) < 0))
- goto out_free;
- }
-
- return 0;
-
-out_free:
- perf_evlist__free_stats(evlist);
- return -1;
-}
-
-static void perf_evlist__reset_stats(struct perf_evlist *evlist)
-{
- struct perf_evsel *evsel;
-
- evlist__for_each(evlist, evsel) {
- perf_evsel__reset_stat_priv(evsel);
- perf_evsel__reset_counts(evsel);
- }
-}
-
static void perf_stat__reset_stats(void)
{
perf_evlist__reset_stats(evsel_list);
OpenPOWER on IntegriCloud