Commit | Line | Data |
---|---|---|
361c99a6 ACM |
1 | #ifndef __PERF_EVLIST_H |
2 | #define __PERF_EVLIST_H 1 | |
3 | ||
4 | #include <linux/list.h> | |
70db7533 | 5 | #include "../perf.h" |
04391deb | 6 | #include "event.h" |
361c99a6 | 7 | |
5c581041 ACM |
8 | struct pollfd; |
9 | ||
70db7533 ACM |
10 | #define PERF_EVLIST__HLIST_BITS 8 |
11 | #define PERF_EVLIST__HLIST_SIZE (1 << PERF_EVLIST__HLIST_BITS) | |
12 | ||
361c99a6 ACM |
13 | struct perf_evlist { |
14 | struct list_head entries; | |
70db7533 | 15 | struct hlist_head heads[PERF_EVLIST__HLIST_SIZE]; |
361c99a6 | 16 | int nr_entries; |
5c581041 | 17 | int nr_fds; |
70db7533 | 18 | int mmap_len; |
7bb41152 | 19 | bool overwrite; |
8115d60c | 20 | union perf_event event_copy; |
70db7533 | 21 | struct perf_mmap *mmap; |
5c581041 | 22 | struct pollfd *pollfd; |
361c99a6 ACM |
23 | }; |
24 | ||
25 | struct perf_evsel; | |
26 | ||
27 | struct perf_evlist *perf_evlist__new(void); | |
ef1d1af2 ACM |
28 | void perf_evlist__init(struct perf_evlist *evlist); |
29 | void perf_evlist__exit(struct perf_evlist *evlist); | |
361c99a6 ACM |
30 | void perf_evlist__delete(struct perf_evlist *evlist); |
31 | ||
32 | void perf_evlist__add(struct perf_evlist *evlist, struct perf_evsel *entry); | |
33 | int perf_evlist__add_default(struct perf_evlist *evlist); | |
34 | ||
5c581041 | 35 | int perf_evlist__alloc_pollfd(struct perf_evlist *evlist, int ncpus, int nthreads); |
70082dd9 | 36 | void perf_evlist__add_pollfd(struct perf_evlist *evlist, int fd); |
5c581041 | 37 | |
70db7533 ACM |
38 | struct perf_evsel *perf_evlist__id2evsel(struct perf_evlist *evlist, u64 id); |
39 | ||
8115d60c | 40 | union perf_event *perf_evlist__read_on_cpu(struct perf_evlist *self, int cpu); |
04391deb | 41 | |
361c99a6 | 42 | #endif /* __PERF_EVLIST_H */ |