5 struct perf_counts
*perf_counts__new(int ncpus
, int nthreads
)
7 struct perf_counts
*counts
= zalloc(sizeof(*counts
));
10 struct xyarray
*values
;
12 values
= xyarray__new(ncpus
, nthreads
, sizeof(struct perf_counts_values
));
18 counts
->values
= values
;
24 void perf_counts__delete(struct perf_counts
*counts
)
27 xyarray__delete(counts
->values
);
32 static void perf_counts__reset(struct perf_counts
*counts
)
34 xyarray__reset(counts
->values
);
37 void perf_evsel__reset_counts(struct perf_evsel
*evsel
)
39 perf_counts__reset(evsel
->counts
);
42 int perf_evsel__alloc_counts(struct perf_evsel
*evsel
, int ncpus
, int nthreads
)
44 evsel
->counts
= perf_counts__new(ncpus
, nthreads
);
45 return evsel
->counts
!= NULL
? 0 : -ENOMEM
;
48 void perf_evsel__free_counts(struct perf_evsel
*evsel
)
50 perf_counts__delete(evsel
->counts
);