mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
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 <[email protected]> Cc: Adrian Hunter <[email protected]> Cc: Andi Kleen <[email protected]> Cc: David Ahern <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Stephane Eranian <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
This commit is contained in:
parent
9689edfabc
commit
a939512d10
3 changed files with 22 additions and 18 deletions
|
|
@ -141,24 +141,6 @@ static inline void diff_timespec(struct timespec *r, struct timespec *a,
|
|||
}
|
||||
}
|
||||
|
||||
static 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;
|
||||
}
|
||||
|
||||
static void perf_evsel__free_prev_raw_counts(struct perf_evsel *evsel)
|
||||
{
|
||||
perf_counts__delete(evsel->prev_raw_counts);
|
||||
evsel->prev_raw_counts = NULL;
|
||||
}
|
||||
|
||||
static void perf_evlist__free_stats(struct perf_evlist *evlist)
|
||||
{
|
||||
struct perf_evsel *evsel;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -96,4 +96,8 @@ void perf_evsel__free_counts(struct perf_evsel *evsel);
|
|||
void perf_evsel__reset_stat_priv(struct perf_evsel *evsel);
|
||||
int perf_evsel__alloc_stat_priv(struct perf_evsel *evsel);
|
||||
void perf_evsel__free_stat_priv(struct perf_evsel *evsel);
|
||||
|
||||
int perf_evsel__alloc_prev_raw_counts(struct perf_evsel *evsel,
|
||||
int ncpus, int nthreads);
|
||||
void perf_evsel__free_prev_raw_counts(struct perf_evsel *evsel);
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in a new issue