diff options
author | Jiri Olsa <jolsa@kernel.org> | 2015-06-26 12:29:15 +0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2015-06-26 17:34:43 +0300 |
commit | a939512d10a5583a32ae85c1bff6c4ae63a8a517 (patch) | |
tree | 744fd2af041df742ff3c320dfa1ef2ae69e18255 /tools/perf/util/stat.c | |
parent | 9689edfabc1547155a7cdd1304fd294107054291 (diff) | |
download | linux-a939512d10a5583a32ae85c1bff6c4ae63a8a517.tar.xz |
perf stat: Move perf_evsel__(alloc|free)_prev_raw_counts into stat object
Moving perf_evsel__(alloc|free)_prev_raw_counts 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-11-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/stat.c')
-rw-r--r-- | tools/perf/util/stat.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tools/perf/util/stat.c b/tools/perf/util/stat.c index b8c329f41f13..6221c3898397 100644 --- a/tools/perf/util/stat.c +++ b/tools/perf/util/stat.c @@ -168,3 +168,21 @@ void perf_evsel__free_stat_priv(struct perf_evsel *evsel) { zfree(&evsel->priv); } + +int perf_evsel__alloc_prev_raw_counts(struct perf_evsel *evsel, + int ncpus, int nthreads) +{ + struct perf_counts *counts; + + counts = perf_counts__new(ncpus, nthreads); + if (counts) + evsel->prev_raw_counts = counts; + + return counts ? 0 : -ENOMEM; +} + +void perf_evsel__free_prev_raw_counts(struct perf_evsel *evsel) +{ + perf_counts__delete(evsel->prev_raw_counts); + evsel->prev_raw_counts = NULL; +} |