evsel.h 689 B

12345678910111213141516171819202122232425262728
  1. #ifndef __PERF_EVSEL_H
  2. #define __PERF_EVSEL_H 1
  3. #include <linux/list.h>
  4. #include <linux/perf_event.h>
  5. #include "types.h"
  6. #include "xyarray.h"
  7. struct perf_evsel {
  8. struct list_head node;
  9. struct perf_event_attr attr;
  10. char *filter;
  11. struct xyarray *fd;
  12. int idx;
  13. void *priv;
  14. };
  15. struct perf_evsel *perf_evsel__new(u32 type, u64 config, int idx);
  16. void perf_evsel__delete(struct perf_evsel *evsel);
  17. int perf_evsel__alloc_fd(struct perf_evsel *evsel, int ncpus, int nthreads);
  18. void perf_evsel__free_fd(struct perf_evsel *evsel);
  19. #define perf_evsel__match(evsel, t, c) \
  20. (evsel->attr.type == PERF_TYPE_##t && \
  21. evsel->attr.config == PERF_COUNT_##c)
  22. #endif /* __PERF_EVSEL_H */