aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/evlist.h
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/util/evlist.h')
-rw-r--r--tools/perf/util/evlist.h26
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
27struct perf_evlist { 27struct 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
55struct perf_evlist *perf_evlist__new(void); 55struct perf_evlist *perf_evlist__new(void);
56struct perf_evlist *perf_evlist__new_default(void);
56void perf_evlist__init(struct perf_evlist *evlist, struct cpu_map *cpus, 57void perf_evlist__init(struct perf_evlist *evlist, struct cpu_map *cpus,
57 struct thread_map *threads); 58 struct thread_map *threads);
58void perf_evlist__exit(struct perf_evlist *evlist); 59void 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
88struct perf_sample_id *perf_evlist__id2sid(struct perf_evlist *evlist, u64 id); 89struct perf_sample_id *perf_evlist__id2sid(struct perf_evlist *evlist, u64 id);
89 90
90union perf_event *perf_evlist__mmap_read(struct perf_evlist *self, int idx); 91union perf_event *perf_evlist__mmap_read(struct perf_evlist *evlist, int idx);
92
93void perf_evlist__mmap_consume(struct perf_evlist *evlist, int idx);
91 94
92int perf_evlist__open(struct perf_evlist *evlist); 95int perf_evlist__open(struct perf_evlist *evlist);
93void perf_evlist__close(struct perf_evlist *evlist); 96void perf_evlist__close(struct perf_evlist *evlist);
@@ -96,13 +99,18 @@ void perf_evlist__set_id_pos(struct perf_evlist *evlist);
96bool perf_can_sample_identifier(void); 99bool perf_can_sample_identifier(void);
97void perf_evlist__config(struct perf_evlist *evlist, 100void perf_evlist__config(struct perf_evlist *evlist,
98 struct perf_record_opts *opts); 101 struct perf_record_opts *opts);
102int perf_record_opts__config(struct perf_record_opts *opts);
99 103
100int perf_evlist__prepare_workload(struct perf_evlist *evlist, 104int 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);
104int perf_evlist__start_workload(struct perf_evlist *evlist); 108int perf_evlist__start_workload(struct perf_evlist *evlist);
105 109
110int perf_evlist__parse_mmap_pages(const struct option *opt,
111 const char *str,
112 int unset);
113
106int perf_evlist__mmap(struct perf_evlist *evlist, unsigned int pages, 114int perf_evlist__mmap(struct perf_evlist *evlist, unsigned int pages,
107 bool overwrite); 115 bool overwrite);
108void perf_evlist__munmap(struct perf_evlist *evlist); 116void 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
129int perf_evlist__create_maps(struct perf_evlist *evlist, 137int perf_evlist__create_maps(struct perf_evlist *evlist, struct target *target);
130 struct perf_target *target);
131void perf_evlist__delete_maps(struct perf_evlist *evlist); 138void perf_evlist__delete_maps(struct perf_evlist *evlist);
132int perf_evlist__apply_filters(struct perf_evlist *evlist); 139int 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
164size_t perf_evlist__fprintf(struct perf_evlist *evlist, FILE *fp); 171size_t perf_evlist__fprintf(struct perf_evlist *evlist, FILE *fp);
165 172
173int perf_evlist__strerror_tp(struct perf_evlist *evlist, int err, char *buf, size_t size);
174int perf_evlist__strerror_open(struct perf_evlist *evlist, int err, char *buf, size_t size);
175
166static inline unsigned int perf_mmap__read_head(struct perf_mmap *mm) 176static 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