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; |
04391deb | 19 | event_t event_copy; |
70db7533 | 20 | struct perf_mmap *mmap; |
5c581041 | 21 | struct pollfd *pollfd; |
361c99a6 ACM |
22 | }; |
23 | ||
24 | struct perf_evsel; | |
25 | ||
26 | struct perf_evlist *perf_evlist__new(void); | |
ef1d1af2 ACM |
27 | void perf_evlist__init(struct perf_evlist *evlist); |
28 | void perf_evlist__exit(struct perf_evlist *evlist); | |
361c99a6 ACM |
29 | void perf_evlist__delete(struct perf_evlist *evlist); |
30 | ||
31 | void perf_evlist__add(struct perf_evlist *evlist, struct perf_evsel *entry); | |
32 | int perf_evlist__add_default(struct perf_evlist *evlist); | |
33 | ||
5c581041 | 34 | int perf_evlist__alloc_pollfd(struct perf_evlist *evlist, int ncpus, int nthreads); |
70082dd9 | 35 | void perf_evlist__add_pollfd(struct perf_evlist *evlist, int fd); |
5c581041 | 36 | |
70db7533 ACM |
37 | struct perf_evsel *perf_evlist__id2evsel(struct perf_evlist *evlist, u64 id); |
38 | ||
04391deb ACM |
39 | event_t *perf_evlist__read_on_cpu(struct perf_evlist *self, int cpu); |
40 | ||
361c99a6 | 41 | #endif /* __PERF_EVLIST_H */ |