diff options
Diffstat (limited to 'tools/perf/util/evlist.h')
-rw-r--r-- | tools/perf/util/evlist.h | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/tools/perf/util/evlist.h b/tools/perf/util/evlist.h index 880d7139d2fb..649d6ea98a84 100644 --- a/tools/perf/util/evlist.h +++ b/tools/perf/util/evlist.h | |||
@@ -21,7 +21,7 @@ struct perf_mmap { | |||
21 | void *base; | 21 | void *base; |
22 | int mask; | 22 | int mask; |
23 | unsigned int prev; | 23 | unsigned int prev; |
24 | union perf_event event_copy; | 24 | char event_copy[PERF_SAMPLE_MAX_SIZE]; |
25 | }; | 25 | }; |
26 | 26 | ||
27 | struct perf_evlist { | 27 | struct perf_evlist { |
@@ -31,7 +31,7 @@ struct perf_evlist { | |||
31 | int nr_groups; | 31 | int nr_groups; |
32 | int nr_fds; | 32 | int nr_fds; |
33 | int nr_mmaps; | 33 | int nr_mmaps; |
34 | int mmap_len; | 34 | size_t mmap_len; |
35 | int id_pos; | 35 | int id_pos; |
36 | int is_pos; | 36 | int is_pos; |
37 | u64 combined_sample_type; | 37 | u64 combined_sample_type; |
@@ -53,6 +53,7 @@ struct perf_evsel_str_handler { | |||
53 | }; | 53 | }; |
54 | 54 | ||
55 | struct perf_evlist *perf_evlist__new(void); | 55 | struct perf_evlist *perf_evlist__new(void); |
56 | struct perf_evlist *perf_evlist__new_default(void); | ||
56 | void perf_evlist__init(struct perf_evlist *evlist, struct cpu_map *cpus, | 57 | void perf_evlist__init(struct perf_evlist *evlist, struct cpu_map *cpus, |
57 | struct thread_map *threads); | 58 | struct thread_map *threads); |
58 | void perf_evlist__exit(struct perf_evlist *evlist); | 59 | void perf_evlist__exit(struct perf_evlist *evlist); |
@@ -87,7 +88,9 @@ struct perf_evsel *perf_evlist__id2evsel(struct perf_evlist *evlist, u64 id); | |||
87 | 88 | ||
88 | struct perf_sample_id *perf_evlist__id2sid(struct perf_evlist *evlist, u64 id); | 89 | struct perf_sample_id *perf_evlist__id2sid(struct perf_evlist *evlist, u64 id); |
89 | 90 | ||
90 | union perf_event *perf_evlist__mmap_read(struct perf_evlist *self, int idx); | 91 | union perf_event *perf_evlist__mmap_read(struct perf_evlist *evlist, int idx); |
92 | |||
93 | void perf_evlist__mmap_consume(struct perf_evlist *evlist, int idx); | ||
91 | 94 | ||
92 | int perf_evlist__open(struct perf_evlist *evlist); | 95 | int perf_evlist__open(struct perf_evlist *evlist); |
93 | void perf_evlist__close(struct perf_evlist *evlist); | 96 | void perf_evlist__close(struct perf_evlist *evlist); |
@@ -96,13 +99,18 @@ void perf_evlist__set_id_pos(struct perf_evlist *evlist); | |||
96 | bool perf_can_sample_identifier(void); | 99 | bool perf_can_sample_identifier(void); |
97 | void perf_evlist__config(struct perf_evlist *evlist, | 100 | void perf_evlist__config(struct perf_evlist *evlist, |
98 | struct perf_record_opts *opts); | 101 | struct perf_record_opts *opts); |
102 | int perf_record_opts__config(struct perf_record_opts *opts); | ||
99 | 103 | ||
100 | int perf_evlist__prepare_workload(struct perf_evlist *evlist, | 104 | int perf_evlist__prepare_workload(struct perf_evlist *evlist, |
101 | struct perf_target *target, | 105 | struct target *target, |
102 | const char *argv[], bool pipe_output, | 106 | const char *argv[], bool pipe_output, |
103 | bool want_signal); | 107 | bool want_signal); |
104 | int perf_evlist__start_workload(struct perf_evlist *evlist); | 108 | int perf_evlist__start_workload(struct perf_evlist *evlist); |
105 | 109 | ||
110 | int perf_evlist__parse_mmap_pages(const struct option *opt, | ||
111 | const char *str, | ||
112 | int unset); | ||
113 | |||
106 | int perf_evlist__mmap(struct perf_evlist *evlist, unsigned int pages, | 114 | int perf_evlist__mmap(struct perf_evlist *evlist, unsigned int pages, |
107 | bool overwrite); | 115 | bool overwrite); |
108 | void perf_evlist__munmap(struct perf_evlist *evlist); | 116 | void perf_evlist__munmap(struct perf_evlist *evlist); |
@@ -126,8 +134,7 @@ static inline void perf_evlist__set_maps(struct perf_evlist *evlist, | |||
126 | evlist->threads = threads; | 134 | evlist->threads = threads; |
127 | } | 135 | } |
128 | 136 | ||
129 | int perf_evlist__create_maps(struct perf_evlist *evlist, | 137 | int perf_evlist__create_maps(struct perf_evlist *evlist, struct target *target); |
130 | struct perf_target *target); | ||
131 | void perf_evlist__delete_maps(struct perf_evlist *evlist); | 138 | void perf_evlist__delete_maps(struct perf_evlist *evlist); |
132 | int perf_evlist__apply_filters(struct perf_evlist *evlist); | 139 | int perf_evlist__apply_filters(struct perf_evlist *evlist); |
133 | 140 | ||
@@ -163,10 +170,13 @@ static inline struct perf_evsel *perf_evlist__last(struct perf_evlist *evlist) | |||
163 | 170 | ||
164 | size_t perf_evlist__fprintf(struct perf_evlist *evlist, FILE *fp); | 171 | size_t perf_evlist__fprintf(struct perf_evlist *evlist, FILE *fp); |
165 | 172 | ||
173 | int perf_evlist__strerror_tp(struct perf_evlist *evlist, int err, char *buf, size_t size); | ||
174 | int perf_evlist__strerror_open(struct perf_evlist *evlist, int err, char *buf, size_t size); | ||
175 | |||
166 | static inline unsigned int perf_mmap__read_head(struct perf_mmap *mm) | 176 | static inline unsigned int perf_mmap__read_head(struct perf_mmap *mm) |
167 | { | 177 | { |
168 | struct perf_event_mmap_page *pc = mm->base; | 178 | struct perf_event_mmap_page *pc = mm->base; |
169 | int head = pc->data_head; | 179 | int head = ACCESS_ONCE(pc->data_head); |
170 | rmb(); | 180 | rmb(); |
171 | return head; | 181 | return head; |
172 | } | 182 | } |
@@ -179,7 +189,7 @@ static inline void perf_mmap__write_tail(struct perf_mmap *md, | |||
179 | /* | 189 | /* |
180 | * ensure all reads are done before we write the tail out. | 190 | * ensure all reads are done before we write the tail out. |
181 | */ | 191 | */ |
182 | /* mb(); */ | 192 | mb(); |
183 | pc->data_tail = tail; | 193 | pc->data_tail = tail; |
184 | } | 194 | } |
185 | 195 | ||