diff options
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) | |||
168 | { | 168 | { |
169 | zfree(&evsel->priv); | 169 | zfree(&evsel->priv); |
170 | } | 170 | } |
171 | |||
172 | int perf_evsel__alloc_prev_raw_counts(struct perf_evsel *evsel, | ||
173 | int ncpus, int nthreads) | ||
174 | { | ||
175 | struct perf_counts *counts; | ||
176 | |||
177 | counts = perf_counts__new(ncpus, nthreads); | ||
178 | if (counts) | ||
179 | evsel->prev_raw_counts = counts; | ||
180 | |||
181 | return counts ? 0 : -ENOMEM; | ||
182 | } | ||
183 | |||
184 | void perf_evsel__free_prev_raw_counts(struct perf_evsel *evsel) | ||
185 | { | ||
186 | perf_counts__delete(evsel->prev_raw_counts); | ||
187 | evsel->prev_raw_counts = NULL; | ||
188 | } | ||