Linux Audio

Check our new training course

Loading...
v3.5.6
 
  1#ifndef __PERF_EVLIST_H
  2#define __PERF_EVLIST_H 1
  3
 
 
 
  4#include <linux/list.h>
  5#include <stdio.h>
  6#include "../perf.h"
  7#include "event.h"
  8#include "util.h"
 
 
 
 
  9#include <unistd.h>
 10
 11struct pollfd;
 12struct thread_map;
 13struct cpu_map;
 14struct perf_record_opts;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 15
 16#define PERF_EVLIST__HLIST_BITS 8
 17#define PERF_EVLIST__HLIST_SIZE (1 << PERF_EVLIST__HLIST_BITS)
 18
 19struct perf_evlist {
 20	struct list_head entries;
 21	struct hlist_head heads[PERF_EVLIST__HLIST_SIZE];
 22	int		 nr_entries;
 23	int		 nr_fds;
 24	int		 nr_mmaps;
 25	int		 mmap_len;
 
 26	struct {
 27		int	cork_fd;
 28		pid_t	pid;
 29	} workload;
 30	bool		 overwrite;
 31	union perf_event event_copy;
 32	struct perf_mmap *mmap;
 33	struct pollfd	 *pollfd;
 34	struct thread_map *threads;
 35	struct cpu_map	  *cpus;
 36	struct perf_evsel *selected;
 
 
 
 
 
 
 
 
 
 
 
 
 
 37};
 38
 39struct perf_evsel_str_handler {
 40	const char *name;
 41	void	   *handler;
 42};
 43
 44struct perf_evsel;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 45
 46struct perf_evlist *perf_evlist__new(struct cpu_map *cpus,
 47				     struct thread_map *threads);
 48void perf_evlist__init(struct perf_evlist *evlist, struct cpu_map *cpus,
 49		       struct thread_map *threads);
 50void perf_evlist__exit(struct perf_evlist *evlist);
 51void perf_evlist__delete(struct perf_evlist *evlist);
 52
 53void perf_evlist__add(struct perf_evlist *evlist, struct perf_evsel *entry);
 54int perf_evlist__add_default(struct perf_evlist *evlist);
 55int perf_evlist__add_attrs(struct perf_evlist *evlist,
 56			   struct perf_event_attr *attrs, size_t nr_attrs);
 57int __perf_evlist__add_default_attrs(struct perf_evlist *evlist,
 58				     struct perf_event_attr *attrs, size_t nr_attrs);
 59int perf_evlist__add_tracepoints(struct perf_evlist *evlist,
 60				 const char *tracepoints[], size_t nr_tracepoints);
 61int perf_evlist__set_tracepoints_handlers(struct perf_evlist *evlist,
 62					  const struct perf_evsel_str_handler *assocs,
 63					  size_t nr_assocs);
 64
 65#define perf_evlist__add_attrs_array(evlist, array) \
 66	perf_evlist__add_attrs(evlist, array, ARRAY_SIZE(array))
 67#define perf_evlist__add_default_attrs(evlist, array) \
 68	__perf_evlist__add_default_attrs(evlist, array, ARRAY_SIZE(array))
 69
 70#define perf_evlist__add_tracepoints_array(evlist, array) \
 71	perf_evlist__add_tracepoints(evlist, array, ARRAY_SIZE(array))
 72
 73#define perf_evlist__set_tracepoints_handlers_array(evlist, array) \
 74	perf_evlist__set_tracepoints_handlers(evlist, array, ARRAY_SIZE(array))
 75
 76void perf_evlist__id_add(struct perf_evlist *evlist, struct perf_evsel *evsel,
 77			 int cpu, int thread, u64 id);
 78
 79void perf_evlist__add_pollfd(struct perf_evlist *evlist, int fd);
 80
 81struct perf_evsel *perf_evlist__id2evsel(struct perf_evlist *evlist, u64 id);
 82
 83union perf_event *perf_evlist__mmap_read(struct perf_evlist *self, int idx);
 84
 85int perf_evlist__open(struct perf_evlist *evlist, bool group);
 86
 87void perf_evlist__config_attrs(struct perf_evlist *evlist,
 88			       struct perf_record_opts *opts);
 89
 90int perf_evlist__prepare_workload(struct perf_evlist *evlist,
 91				  struct perf_record_opts *opts,
 92				  const char *argv[]);
 93int perf_evlist__start_workload(struct perf_evlist *evlist);
 94
 95int perf_evlist__mmap(struct perf_evlist *evlist, unsigned int pages,
 96		      bool overwrite);
 97void perf_evlist__munmap(struct perf_evlist *evlist);
 98
 99void perf_evlist__disable(struct perf_evlist *evlist);
100void perf_evlist__enable(struct perf_evlist *evlist);
101
102void perf_evlist__set_selected(struct perf_evlist *evlist,
103			       struct perf_evsel *evsel);
104
105static inline void perf_evlist__set_maps(struct perf_evlist *evlist,
106					 struct cpu_map *cpus,
107					 struct thread_map *threads)
108{
109	evlist->cpus	= cpus;
110	evlist->threads	= threads;
111}
112
113int perf_evlist__create_maps(struct perf_evlist *evlist,
114			     struct perf_target *target);
115void perf_evlist__delete_maps(struct perf_evlist *evlist);
116int perf_evlist__set_filters(struct perf_evlist *evlist);
117
118u64 perf_evlist__sample_type(const struct perf_evlist *evlist);
119bool perf_evlist__sample_id_all(const const struct perf_evlist *evlist);
120u16 perf_evlist__id_hdr_size(const struct perf_evlist *evlist);
121
122bool perf_evlist__valid_sample_type(const struct perf_evlist *evlist);
123bool perf_evlist__valid_sample_id_all(const struct perf_evlist *evlist);
124
125void perf_evlist__splice_list_tail(struct perf_evlist *evlist,
126				   struct list_head *list,
127				   int nr_entries);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
128
129#endif /* __PERF_EVLIST_H */
v6.13.7
  1/* SPDX-License-Identifier: GPL-2.0 */
  2#ifndef __PERF_EVLIST_H
  3#define __PERF_EVLIST_H 1
  4
  5#include <linux/compiler.h>
  6#include <linux/kernel.h>
  7#include <linux/refcount.h>
  8#include <linux/list.h>
  9#include <api/fd/array.h>
 10#include <internal/evlist.h>
 11#include <internal/evsel.h>
 12#include <perf/evlist.h>
 13#include "events_stats.h"
 14#include "evsel.h"
 15#include <pthread.h>
 16#include <signal.h>
 17#include <unistd.h>
 18
 19struct pollfd;
 20struct thread_map;
 21struct perf_cpu_map;
 22struct record_opts;
 23struct target;
 24
 25/*
 26 * State machine of bkw_mmap_state:
 27 *
 28 *                     .________________(forbid)_____________.
 29 *                     |                                     V
 30 * NOTREADY --(0)--> RUNNING --(1)--> DATA_PENDING --(2)--> EMPTY
 31 *                     ^  ^              |   ^               |
 32 *                     |  |__(forbid)____/   |___(forbid)___/|
 33 *                     |                                     |
 34 *                      \_________________(3)_______________/
 35 *
 36 * NOTREADY     : Backward ring buffers are not ready
 37 * RUNNING      : Backward ring buffers are recording
 38 * DATA_PENDING : We are required to collect data from backward ring buffers
 39 * EMPTY        : We have collected data from backward ring buffers.
 40 *
 41 * (0): Setup backward ring buffer
 42 * (1): Pause ring buffers for reading
 43 * (2): Read from ring buffers
 44 * (3): Resume ring buffers for recording
 45 */
 46enum bkw_mmap_state {
 47	BKW_MMAP_NOTREADY,
 48	BKW_MMAP_RUNNING,
 49	BKW_MMAP_DATA_PENDING,
 50	BKW_MMAP_EMPTY,
 51};
 52
 53struct event_enable_timer;
 
 54
 55struct evlist {
 56	struct perf_evlist core;
 57	bool		 enabled;
 58	int		 id_pos;
 59	int		 is_pos;
 60	int		 nr_br_cntr;
 61	u64		 combined_sample_type;
 62	enum bkw_mmap_state bkw_mmap_state;
 63	struct {
 64		int	cork_fd;
 65		pid_t	pid;
 66	} workload;
 67	struct mmap *mmap;
 68	struct mmap *overwrite_mmap;
 69	struct evsel *selected;
 70	struct events_stats stats;
 71	struct perf_env	*env;
 72	void (*trace_event_sample_raw)(struct evlist *evlist,
 73				       union perf_event *event,
 74				       struct perf_sample *sample);
 75	u64		first_sample_time;
 76	u64		last_sample_time;
 77	struct {
 78		pthread_t		th;
 79		volatile int		done;
 80	} thread;
 81	struct {
 82		int	fd;	/* control file descriptor */
 83		int	ack;	/* ack file descriptor for control commands */
 84		int	pos;	/* index at evlist core object to check signals */
 85	} ctl_fd;
 86	struct event_enable_timer *eet;
 87};
 88
 89struct evsel_str_handler {
 90	const char *name;
 91	void	   *handler;
 92};
 93
 94struct evlist *evlist__new(void);
 95struct evlist *evlist__new_default(void);
 96struct evlist *evlist__new_dummy(void);
 97void evlist__init(struct evlist *evlist, struct perf_cpu_map *cpus,
 98		  struct perf_thread_map *threads);
 99void evlist__exit(struct evlist *evlist);
100void evlist__delete(struct evlist *evlist);
101
102void evlist__add(struct evlist *evlist, struct evsel *entry);
103void evlist__remove(struct evlist *evlist, struct evsel *evsel);
104
105int arch_evlist__cmp(const struct evsel *lhs, const struct evsel *rhs);
106
107int evlist__add_dummy(struct evlist *evlist);
108struct evsel *evlist__add_aux_dummy(struct evlist *evlist, bool system_wide);
109static inline struct evsel *evlist__add_dummy_on_all_cpus(struct evlist *evlist)
110{
111	return evlist__add_aux_dummy(evlist, true);
112}
113#ifdef HAVE_LIBTRACEEVENT
114struct evsel *evlist__add_sched_switch(struct evlist *evlist, bool system_wide);
115#endif
116
117int evlist__add_sb_event(struct evlist *evlist, struct perf_event_attr *attr,
118			 evsel__sb_cb_t cb, void *data);
119void evlist__set_cb(struct evlist *evlist, evsel__sb_cb_t cb, void *data);
120int evlist__start_sb_thread(struct evlist *evlist, struct target *target);
121void evlist__stop_sb_thread(struct evlist *evlist);
122
123#ifdef HAVE_LIBTRACEEVENT
124int evlist__add_newtp(struct evlist *evlist, const char *sys, const char *name, void *handler);
125#endif
126
127int __evlist__set_tracepoints_handlers(struct evlist *evlist,
128				       const struct evsel_str_handler *assocs,
129				       size_t nr_assocs);
130
131#define evlist__set_tracepoints_handlers(evlist, array) \
132	__evlist__set_tracepoints_handlers(evlist, array, ARRAY_SIZE(array))
133
134int evlist__set_tp_filter(struct evlist *evlist, const char *filter);
135int evlist__set_tp_filter_pids(struct evlist *evlist, size_t npids, pid_t *pids);
136
137int evlist__append_tp_filter(struct evlist *evlist, const char *filter);
138
139int evlist__append_tp_filter_pid(struct evlist *evlist, pid_t pid);
140int evlist__append_tp_filter_pids(struct evlist *evlist, size_t npids, pid_t *pids);
141
142struct evsel *evlist__find_tracepoint_by_name(struct evlist *evlist, const char *name);
143
144int evlist__add_pollfd(struct evlist *evlist, int fd);
145int evlist__filter_pollfd(struct evlist *evlist, short revents_and_mask);
146
147#ifdef HAVE_EVENTFD_SUPPORT
148int evlist__add_wakeup_eventfd(struct evlist *evlist, int fd);
149#endif
150
151int evlist__poll(struct evlist *evlist, int timeout);
152
153struct evsel *evlist__id2evsel(struct evlist *evlist, u64 id);
154struct evsel *evlist__id2evsel_strict(struct evlist *evlist, u64 id);
155
156struct perf_sample_id *evlist__id2sid(struct evlist *evlist, u64 id);
157
158void evlist__toggle_bkw_mmap(struct evlist *evlist, enum bkw_mmap_state state);
159
160void evlist__mmap_consume(struct evlist *evlist, int idx);
161
162int evlist__open(struct evlist *evlist);
163void evlist__close(struct evlist *evlist);
164
165struct callchain_param;
166
167void evlist__set_id_pos(struct evlist *evlist);
168void evlist__config(struct evlist *evlist, struct record_opts *opts, struct callchain_param *callchain);
169int record_opts__config(struct record_opts *opts);
170
171int evlist__prepare_workload(struct evlist *evlist, struct target *target,
172			     const char *argv[], bool pipe_output,
173			     void (*exec_error)(int signo, siginfo_t *info, void *ucontext));
174int evlist__start_workload(struct evlist *evlist);
175void evlist__cancel_workload(struct evlist *evlist);
176
177struct option;
178
179int __evlist__parse_mmap_pages(unsigned int *mmap_pages, const char *str);
180int evlist__parse_mmap_pages(const struct option *opt, const char *str, int unset);
181
182unsigned long perf_event_mlock_kb_in_pages(void);
183
184int evlist__mmap_ex(struct evlist *evlist, unsigned int pages,
185			 unsigned int auxtrace_pages,
186			 bool auxtrace_overwrite, int nr_cblocks,
187			 int affinity, int flush, int comp_level);
188int evlist__mmap(struct evlist *evlist, unsigned int pages);
189void evlist__munmap(struct evlist *evlist);
190
191size_t evlist__mmap_size(unsigned long pages);
192
193void evlist__disable(struct evlist *evlist);
194void evlist__enable(struct evlist *evlist);
195void evlist__toggle_enable(struct evlist *evlist);
196void evlist__disable_evsel(struct evlist *evlist, char *evsel_name);
197void evlist__enable_evsel(struct evlist *evlist, char *evsel_name);
198void evlist__disable_non_dummy(struct evlist *evlist);
199void evlist__enable_non_dummy(struct evlist *evlist);
200
201void evlist__set_selected(struct evlist *evlist, struct evsel *evsel);
202
203int evlist__create_maps(struct evlist *evlist, struct target *target);
204int evlist__apply_filters(struct evlist *evlist, struct evsel **err_evsel,
205			  struct target *target);
206
207u64 __evlist__combined_sample_type(struct evlist *evlist);
208u64 evlist__combined_sample_type(struct evlist *evlist);
209u64 evlist__combined_branch_type(struct evlist *evlist);
210void evlist__update_br_cntr(struct evlist *evlist);
211bool evlist__sample_id_all(struct evlist *evlist);
212u16 evlist__id_hdr_size(struct evlist *evlist);
213
214int evlist__parse_sample(struct evlist *evlist, union perf_event *event, struct perf_sample *sample);
215int evlist__parse_sample_timestamp(struct evlist *evlist, union perf_event *event, u64 *timestamp);
216
217bool evlist__valid_sample_type(struct evlist *evlist);
218bool evlist__valid_sample_id_all(struct evlist *evlist);
219bool evlist__valid_read_format(struct evlist *evlist);
220
221void evlist__splice_list_tail(struct evlist *evlist, struct list_head *list);
222
223static inline bool evlist__empty(struct evlist *evlist)
224{
225	return list_empty(&evlist->core.entries);
226}
227
228static inline struct evsel *evlist__first(struct evlist *evlist)
229{
230	struct perf_evsel *evsel = perf_evlist__first(&evlist->core);
231
232	return container_of(evsel, struct evsel, core);
233}
234
235static inline struct evsel *evlist__last(struct evlist *evlist)
236{
237	struct perf_evsel *evsel = perf_evlist__last(&evlist->core);
238
239	return container_of(evsel, struct evsel, core);
240}
241
242static inline int evlist__nr_groups(struct evlist *evlist)
 
 
 
243{
244	return perf_evlist__nr_groups(&evlist->core);
 
245}
246
247int evlist__strerror_open(struct evlist *evlist, int err, char *buf, size_t size);
248int evlist__strerror_mmap(struct evlist *evlist, int err, char *buf, size_t size);
249
250bool evlist__can_select_event(struct evlist *evlist, const char *str);
251void evlist__to_front(struct evlist *evlist, struct evsel *move_evsel);
252
253/**
254 * __evlist__for_each_entry - iterate thru all the evsels
255 * @list: list_head instance to iterate
256 * @evsel: struct evsel iterator
257 */
258#define __evlist__for_each_entry(list, evsel) \
259        list_for_each_entry(evsel, list, core.node)
260
261/**
262 * evlist__for_each_entry - iterate thru all the evsels
263 * @evlist: evlist instance to iterate
264 * @evsel: struct evsel iterator
265 */
266#define evlist__for_each_entry(evlist, evsel) \
267	__evlist__for_each_entry(&(evlist)->core.entries, evsel)
268
269/**
270 * __evlist__for_each_entry_continue - continue iteration thru all the evsels
271 * @list: list_head instance to iterate
272 * @evsel: struct evsel iterator
273 */
274#define __evlist__for_each_entry_continue(list, evsel) \
275        list_for_each_entry_continue(evsel, list, core.node)
276
277/**
278 * evlist__for_each_entry_continue - continue iteration thru all the evsels
279 * @evlist: evlist instance to iterate
280 * @evsel: struct evsel iterator
281 */
282#define evlist__for_each_entry_continue(evlist, evsel) \
283	__evlist__for_each_entry_continue(&(evlist)->core.entries, evsel)
284
285/**
286 * __evlist__for_each_entry_from - continue iteration from @evsel (included)
287 * @list: list_head instance to iterate
288 * @evsel: struct evsel iterator
289 */
290#define __evlist__for_each_entry_from(list, evsel) \
291	list_for_each_entry_from(evsel, list, core.node)
292
293/**
294 * evlist__for_each_entry_from - continue iteration from @evsel (included)
295 * @evlist: evlist instance to iterate
296 * @evsel: struct evsel iterator
297 */
298#define evlist__for_each_entry_from(evlist, evsel) \
299	__evlist__for_each_entry_from(&(evlist)->core.entries, evsel)
300
301/**
302 * __evlist__for_each_entry_reverse - iterate thru all the evsels in reverse order
303 * @list: list_head instance to iterate
304 * @evsel: struct evsel iterator
305 */
306#define __evlist__for_each_entry_reverse(list, evsel) \
307        list_for_each_entry_reverse(evsel, list, core.node)
308
309/**
310 * evlist__for_each_entry_reverse - iterate thru all the evsels in reverse order
311 * @evlist: evlist instance to iterate
312 * @evsel: struct evsel iterator
313 */
314#define evlist__for_each_entry_reverse(evlist, evsel) \
315	__evlist__for_each_entry_reverse(&(evlist)->core.entries, evsel)
316
317/**
318 * __evlist__for_each_entry_safe - safely iterate thru all the evsels
319 * @list: list_head instance to iterate
320 * @tmp: struct evsel temp iterator
321 * @evsel: struct evsel iterator
322 */
323#define __evlist__for_each_entry_safe(list, tmp, evsel) \
324        list_for_each_entry_safe(evsel, tmp, list, core.node)
325
326/**
327 * evlist__for_each_entry_safe - safely iterate thru all the evsels
328 * @evlist: evlist instance to iterate
329 * @evsel: struct evsel iterator
330 * @tmp: struct evsel temp iterator
331 */
332#define evlist__for_each_entry_safe(evlist, tmp, evsel) \
333	__evlist__for_each_entry_safe(&(evlist)->core.entries, tmp, evsel)
334
335/** Iterator state for evlist__for_each_cpu */
336struct evlist_cpu_iterator {
337	/** The list being iterated through. */
338	struct evlist *container;
339	/** The current evsel of the iterator. */
340	struct evsel *evsel;
341	/** The CPU map index corresponding to the evsel->core.cpus for the current CPU. */
342	int cpu_map_idx;
343	/**
344	 * The CPU map index corresponding to evlist->core.all_cpus for the
345	 * current CPU.  Distinct from cpu_map_idx as the evsel's cpu map may
346	 * contain fewer entries.
347	 */
348	int evlist_cpu_map_idx;
349	/** The number of CPU map entries in evlist->core.all_cpus. */
350	int evlist_cpu_map_nr;
351	/** The current CPU of the iterator. */
352	struct perf_cpu cpu;
353	/** If present, used to set the affinity when switching between CPUs. */
354	struct affinity *affinity;
355};
356
357/**
358 * evlist__for_each_cpu - without affinity, iterate over the evlist. With
359 *                        affinity, iterate over all CPUs and then the evlist
360 *                        for each evsel on that CPU. When switching between
361 *                        CPUs the affinity is set to the CPU to avoid IPIs
362 *                        during syscalls.
363 * @evlist_cpu_itr: the iterator instance.
364 * @evlist: evlist instance to iterate.
365 * @affinity: NULL or used to set the affinity to the current CPU.
366 */
367#define evlist__for_each_cpu(evlist_cpu_itr, evlist, affinity)		\
368	for ((evlist_cpu_itr) = evlist__cpu_begin(evlist, affinity);	\
369	     !evlist_cpu_iterator__end(&evlist_cpu_itr);		\
370	     evlist_cpu_iterator__next(&evlist_cpu_itr))
371
372/** Returns an iterator set to the first CPU/evsel of evlist. */
373struct evlist_cpu_iterator evlist__cpu_begin(struct evlist *evlist, struct affinity *affinity);
374/** Move to next element in iterator, updating CPU, evsel and the affinity. */
375void evlist_cpu_iterator__next(struct evlist_cpu_iterator *evlist_cpu_itr);
376/** Returns true when iterator is at the end of the CPUs and evlist. */
377bool evlist_cpu_iterator__end(const struct evlist_cpu_iterator *evlist_cpu_itr);
378
379struct evsel *evlist__get_tracking_event(struct evlist *evlist);
380void evlist__set_tracking_event(struct evlist *evlist, struct evsel *tracking_evsel);
381struct evsel *evlist__findnew_tracking_event(struct evlist *evlist, bool system_wide);
382
383struct evsel *evlist__find_evsel_by_str(struct evlist *evlist, const char *str);
384
385struct evsel *evlist__event2evsel(struct evlist *evlist, union perf_event *event);
386
387bool evlist__exclude_kernel(struct evlist *evlist);
388
389void evlist__force_leader(struct evlist *evlist);
390
391struct evsel *evlist__reset_weak_group(struct evlist *evlist, struct evsel *evsel, bool close);
392
393#define EVLIST_CTL_CMD_ENABLE_TAG  "enable"
394#define EVLIST_CTL_CMD_DISABLE_TAG "disable"
395#define EVLIST_CTL_CMD_ACK_TAG     "ack\n"
396#define EVLIST_CTL_CMD_SNAPSHOT_TAG "snapshot"
397#define EVLIST_CTL_CMD_EVLIST_TAG "evlist"
398#define EVLIST_CTL_CMD_STOP_TAG "stop"
399#define EVLIST_CTL_CMD_PING_TAG "ping"
400
401#define EVLIST_CTL_CMD_MAX_LEN 64
402
403enum evlist_ctl_cmd {
404	EVLIST_CTL_CMD_UNSUPPORTED = 0,
405	EVLIST_CTL_CMD_ENABLE,
406	EVLIST_CTL_CMD_DISABLE,
407	EVLIST_CTL_CMD_ACK,
408	EVLIST_CTL_CMD_SNAPSHOT,
409	EVLIST_CTL_CMD_EVLIST,
410	EVLIST_CTL_CMD_STOP,
411	EVLIST_CTL_CMD_PING,
412};
413
414int evlist__parse_control(const char *str, int *ctl_fd, int *ctl_fd_ack, bool *ctl_fd_close);
415void evlist__close_control(int ctl_fd, int ctl_fd_ack, bool *ctl_fd_close);
416int evlist__initialize_ctlfd(struct evlist *evlist, int ctl_fd, int ctl_fd_ack);
417int evlist__finalize_ctlfd(struct evlist *evlist);
418bool evlist__ctlfd_initialized(struct evlist *evlist);
419int evlist__ctlfd_process(struct evlist *evlist, enum evlist_ctl_cmd *cmd);
420int evlist__ctlfd_ack(struct evlist *evlist);
421
422#define EVLIST_ENABLED_MSG "Events enabled\n"
423#define EVLIST_DISABLED_MSG "Events disabled\n"
424
425int evlist__parse_event_enable_time(struct evlist *evlist, struct record_opts *opts,
426				    const char *str, int unset);
427int event_enable_timer__start(struct event_enable_timer *eet);
428void event_enable_timer__exit(struct event_enable_timer **ep);
429int event_enable_timer__process(struct event_enable_timer *eet);
430
431struct evsel *evlist__find_evsel(struct evlist *evlist, int idx);
432
433int evlist__scnprintf_evsels(struct evlist *evlist, size_t size, char *bf);
434void evlist__check_mem_load_aux(struct evlist *evlist);
435void evlist__warn_user_requested_cpus(struct evlist *evlist, const char *cpu_list);
436void evlist__uniquify_name(struct evlist *evlist);
437bool evlist__has_bpf_output(struct evlist *evlist);
438
439#endif /* __PERF_EVLIST_H */