1
2 #ifndef __LIBPERF_EVLIST_H
3 #define __LIBPERF_EVLIST_H
4
5 #include <perf/core.h>
6
7 struct perf_evlist;
8 struct perf_evsel;
9 struct perf_cpu_map;
10 struct perf_thread_map;
11
12 LIBPERF_API void perf_evlist__init(struct perf_evlist *evlist);
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);
25
26 #define perf_evlist__for_each_evsel(evlist, pos) \
27 for ((pos) = perf_evlist__next((evlist), NULL); \
28 (pos) != NULL; \
29 (pos) = perf_evlist__next((evlist), (pos)))
30
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
36 #endif