1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __LIBPERF_EVLIST_H
3 #define __LIBPERF_EVLIST_H
11 struct perf_thread_map;
13 LIBPERF_API void perf_evlist__add(struct perf_evlist *evlist,
14 struct perf_evsel *evsel);
15 LIBPERF_API void perf_evlist__remove(struct perf_evlist *evlist,
16 struct perf_evsel *evsel);
17 LIBPERF_API struct perf_evlist *perf_evlist__new(void);
18 LIBPERF_API void perf_evlist__delete(struct perf_evlist *evlist);
19 LIBPERF_API struct perf_evsel* perf_evlist__next(struct perf_evlist *evlist,
20 struct perf_evsel *evsel);
21 LIBPERF_API int perf_evlist__open(struct perf_evlist *evlist);
22 LIBPERF_API void perf_evlist__close(struct perf_evlist *evlist);
23 LIBPERF_API void perf_evlist__enable(struct perf_evlist *evlist);
24 LIBPERF_API void perf_evlist__disable(struct perf_evlist *evlist);
26 #define perf_evlist__for_each_evsel(evlist, pos) \
27 for ((pos) = perf_evlist__next((evlist), NULL); \
29 (pos) = perf_evlist__next((evlist), (pos)))
31 LIBPERF_API void perf_evlist__set_maps(struct perf_evlist *evlist,
32 struct perf_cpu_map *cpus,
33 struct perf_thread_map *threads);
34 LIBPERF_API int perf_evlist__poll(struct perf_evlist *evlist, int timeout);
35 LIBPERF_API int perf_evlist__filter_pollfd(struct perf_evlist *evlist,
36 short revents_and_mask);
38 LIBPERF_API int perf_evlist__mmap(struct perf_evlist *evlist, int pages);
39 LIBPERF_API void perf_evlist__munmap(struct perf_evlist *evlist);
41 LIBPERF_API struct perf_mmap *perf_evlist__next_mmap(struct perf_evlist *evlist,
42 struct perf_mmap *map,
44 #define perf_evlist__for_each_mmap(evlist, pos, overwrite) \
45 for ((pos) = perf_evlist__next_mmap((evlist), NULL, overwrite); \
47 (pos) = perf_evlist__next_mmap((evlist), (pos), overwrite))
49 LIBPERF_API void perf_evlist__set_leader(struct perf_evlist *evlist);
50 #endif /* __LIBPERF_EVLIST_H */