evlist.h 929 B

1234567891011121314151617181920212223242526272829303132333435
  1. #ifndef __PERF_EVLIST_H
  2. #define __PERF_EVLIST_H 1
  3. #include <linux/list.h>
  4. #include "../perf.h"
  5. struct pollfd;
  6. #define PERF_EVLIST__HLIST_BITS 8
  7. #define PERF_EVLIST__HLIST_SIZE (1 << PERF_EVLIST__HLIST_BITS)
  8. struct perf_evlist {
  9. struct list_head entries;
  10. struct hlist_head heads[PERF_EVLIST__HLIST_SIZE];
  11. int nr_entries;
  12. int nr_fds;
  13. int mmap_len;
  14. struct perf_mmap *mmap;
  15. struct pollfd *pollfd;
  16. };
  17. struct perf_evsel;
  18. struct perf_evlist *perf_evlist__new(void);
  19. void perf_evlist__delete(struct perf_evlist *evlist);
  20. void perf_evlist__add(struct perf_evlist *evlist, struct perf_evsel *entry);
  21. int perf_evlist__add_default(struct perf_evlist *evlist);
  22. int perf_evlist__alloc_pollfd(struct perf_evlist *evlist, int ncpus, int nthreads);
  23. void perf_evlist__add_pollfd(struct perf_evlist *evlist, int fd);
  24. struct perf_evsel *perf_evlist__id2evsel(struct perf_evlist *evlist, u64 id);
  25. #endif /* __PERF_EVLIST_H */