counts.h 790 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #ifndef __PERF_COUNTS_H
  2. #define __PERF_COUNTS_H
  3. #include "xyarray.h"
  4. struct perf_counts_values {
  5. union {
  6. struct {
  7. u64 val;
  8. u64 ena;
  9. u64 run;
  10. };
  11. u64 values[3];
  12. };
  13. };
  14. struct perf_counts {
  15. s8 scaled;
  16. struct perf_counts_values aggr;
  17. struct xyarray *values;
  18. };
  19. static inline struct perf_counts_values*
  20. perf_counts(struct perf_counts *counts, int cpu, int thread)
  21. {
  22. return xyarray__entry(counts->values, cpu, thread);
  23. }
  24. struct perf_counts *perf_counts__new(int ncpus, int nthreads);
  25. void perf_counts__delete(struct perf_counts *counts);
  26. void perf_evsel__reset_counts(struct perf_evsel *evsel);
  27. int perf_evsel__alloc_counts(struct perf_evsel *evsel, int ncpus, int nthreads);
  28. void perf_evsel__free_counts(struct perf_evsel *evsel);
  29. #endif /* __PERF_COUNTS_H */