blob: cb45a6aecf9dbc62b4d7850ac806b714f3a423cb [file] [log] [blame]
Jiri Olsad8095602015-08-07 12:51:03 +02001#ifndef __PERF_COUNTS_H
2#define __PERF_COUNTS_H
3
4#include "xyarray.h"
5
6struct perf_counts_values {
7 union {
8 struct {
9 u64 val;
10 u64 ena;
11 u64 run;
12 };
13 u64 values[3];
14 };
Jiri Olsa82bf3112017-07-26 14:02:06 +020015 bool loaded;
Jiri Olsad8095602015-08-07 12:51:03 +020016};
17
18struct perf_counts {
19 s8 scaled;
20 struct perf_counts_values aggr;
21 struct xyarray *values;
22};
23
24
25static inline struct perf_counts_values*
26perf_counts(struct perf_counts *counts, int cpu, int thread)
27{
28 return xyarray__entry(counts->values, cpu, thread);
29}
30
31struct perf_counts *perf_counts__new(int ncpus, int nthreads);
32void perf_counts__delete(struct perf_counts *counts);
33
34void perf_evsel__reset_counts(struct perf_evsel *evsel);
35int perf_evsel__alloc_counts(struct perf_evsel *evsel, int ncpus, int nthreads);
36void perf_evsel__free_counts(struct perf_evsel *evsel);
37
38#endif /* __PERF_COUNTS_H */