diff options
Diffstat (limited to 'tools/perf/util/evlist.h')
-rw-r--r-- | tools/perf/util/evlist.h | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/tools/perf/util/evlist.h b/tools/perf/util/evlist.h index f5173cd63693..649b0c597283 100644 --- a/tools/perf/util/evlist.h +++ b/tools/perf/util/evlist.h | |||
@@ -2,6 +2,7 @@ | |||
2 | #define __PERF_EVLIST_H 1 | 2 | #define __PERF_EVLIST_H 1 |
3 | 3 | ||
4 | #include <linux/list.h> | 4 | #include <linux/list.h> |
5 | #include <api/fd/array.h> | ||
5 | #include <stdio.h> | 6 | #include <stdio.h> |
6 | #include "../perf.h" | 7 | #include "../perf.h" |
7 | #include "event.h" | 8 | #include "event.h" |
@@ -17,9 +18,15 @@ struct record_opts; | |||
17 | #define PERF_EVLIST__HLIST_BITS 8 | 18 | #define PERF_EVLIST__HLIST_BITS 8 |
18 | #define PERF_EVLIST__HLIST_SIZE (1 << PERF_EVLIST__HLIST_BITS) | 19 | #define PERF_EVLIST__HLIST_SIZE (1 << PERF_EVLIST__HLIST_BITS) |
19 | 20 | ||
21 | /** | ||
22 | * struct perf_mmap - perf's ring buffer mmap details | ||
23 | * | ||
24 | * @refcnt - e.g. code using PERF_EVENT_IOC_SET_OUTPUT to share this | ||
25 | */ | ||
20 | struct perf_mmap { | 26 | struct perf_mmap { |
21 | void *base; | 27 | void *base; |
22 | int mask; | 28 | int mask; |
29 | int refcnt; | ||
23 | unsigned int prev; | 30 | unsigned int prev; |
24 | char event_copy[PERF_SAMPLE_MAX_SIZE]; | 31 | char event_copy[PERF_SAMPLE_MAX_SIZE]; |
25 | }; | 32 | }; |
@@ -29,7 +36,6 @@ struct perf_evlist { | |||
29 | struct hlist_head heads[PERF_EVLIST__HLIST_SIZE]; | 36 | struct hlist_head heads[PERF_EVLIST__HLIST_SIZE]; |
30 | int nr_entries; | 37 | int nr_entries; |
31 | int nr_groups; | 38 | int nr_groups; |
32 | int nr_fds; | ||
33 | int nr_mmaps; | 39 | int nr_mmaps; |
34 | size_t mmap_len; | 40 | size_t mmap_len; |
35 | int id_pos; | 41 | int id_pos; |
@@ -40,8 +46,8 @@ struct perf_evlist { | |||
40 | pid_t pid; | 46 | pid_t pid; |
41 | } workload; | 47 | } workload; |
42 | bool overwrite; | 48 | bool overwrite; |
49 | struct fdarray pollfd; | ||
43 | struct perf_mmap *mmap; | 50 | struct perf_mmap *mmap; |
44 | struct pollfd *pollfd; | ||
45 | struct thread_map *threads; | 51 | struct thread_map *threads; |
46 | struct cpu_map *cpus; | 52 | struct cpu_map *cpus; |
47 | struct perf_evsel *selected; | 53 | struct perf_evsel *selected; |
@@ -82,7 +88,11 @@ perf_evlist__find_tracepoint_by_name(struct perf_evlist *evlist, | |||
82 | void perf_evlist__id_add(struct perf_evlist *evlist, struct perf_evsel *evsel, | 88 | void perf_evlist__id_add(struct perf_evlist *evlist, struct perf_evsel *evsel, |
83 | int cpu, int thread, u64 id); | 89 | int cpu, int thread, u64 id); |
84 | 90 | ||
85 | void perf_evlist__add_pollfd(struct perf_evlist *evlist, int fd); | 91 | int perf_evlist__add_pollfd(struct perf_evlist *evlist, int fd); |
92 | int perf_evlist__alloc_pollfd(struct perf_evlist *evlist); | ||
93 | int perf_evlist__filter_pollfd(struct perf_evlist *evlist, short revents_and_mask); | ||
94 | |||
95 | int perf_evlist__poll(struct perf_evlist *evlist, int timeout); | ||
86 | 96 | ||
87 | struct perf_evsel *perf_evlist__id2evsel(struct perf_evlist *evlist, u64 id); | 97 | struct perf_evsel *perf_evlist__id2evsel(struct perf_evlist *evlist, u64 id); |
88 | 98 | ||
@@ -107,6 +117,8 @@ int perf_evlist__prepare_workload(struct perf_evlist *evlist, | |||
107 | void *ucontext)); | 117 | void *ucontext)); |
108 | int perf_evlist__start_workload(struct perf_evlist *evlist); | 118 | int perf_evlist__start_workload(struct perf_evlist *evlist); |
109 | 119 | ||
120 | struct option; | ||
121 | |||
110 | int perf_evlist__parse_mmap_pages(const struct option *opt, | 122 | int perf_evlist__parse_mmap_pages(const struct option *opt, |
111 | const char *str, | 123 | const char *str, |
112 | int unset); | 124 | int unset); |
@@ -122,6 +134,8 @@ int perf_evlist__disable_event(struct perf_evlist *evlist, | |||
122 | struct perf_evsel *evsel); | 134 | struct perf_evsel *evsel); |
123 | int perf_evlist__enable_event(struct perf_evlist *evlist, | 135 | int perf_evlist__enable_event(struct perf_evlist *evlist, |
124 | struct perf_evsel *evsel); | 136 | struct perf_evsel *evsel); |
137 | int perf_evlist__enable_event_idx(struct perf_evlist *evlist, | ||
138 | struct perf_evsel *evsel, int idx); | ||
125 | 139 | ||
126 | void perf_evlist__set_selected(struct perf_evlist *evlist, | 140 | void perf_evlist__set_selected(struct perf_evlist *evlist, |
127 | struct perf_evsel *evsel); | 141 | struct perf_evsel *evsel); |
@@ -262,4 +276,7 @@ void perf_evlist__to_front(struct perf_evlist *evlist, | |||
262 | #define evlist__for_each_safe(evlist, tmp, evsel) \ | 276 | #define evlist__for_each_safe(evlist, tmp, evsel) \ |
263 | __evlist__for_each_safe(&(evlist)->entries, tmp, evsel) | 277 | __evlist__for_each_safe(&(evlist)->entries, tmp, evsel) |
264 | 278 | ||
279 | void perf_evlist__set_tracking_event(struct perf_evlist *evlist, | ||
280 | struct perf_evsel *tracking_evsel); | ||
281 | |||
265 | #endif /* __PERF_EVLIST_H */ | 282 | #endif /* __PERF_EVLIST_H */ |