1
2 #ifndef __LIBPERF_INTERNAL_EVSEL_H
3 #define __LIBPERF_INTERNAL_EVSEL_H
4
5 #include <linux/types.h>
6 #include <linux/perf_event.h>
7 #include <stdbool.h>
8 #include <sys/types.h>
9
10 struct perf_cpu_map;
11 struct perf_thread_map;
12 struct xyarray;
13
14
15
16
17
18 struct perf_sample_id {
19 struct hlist_node node;
20 u64 id;
21 struct perf_evsel *evsel;
22
23
24
25
26
27
28
29 int idx;
30 int cpu;
31 pid_t tid;
32
33
34 u64 period;
35 };
36
37 struct perf_evsel {
38 struct list_head node;
39 struct perf_event_attr attr;
40 struct perf_cpu_map *cpus;
41 struct perf_cpu_map *own_cpus;
42 struct perf_thread_map *threads;
43 struct xyarray *fd;
44 struct xyarray *sample_id;
45 u64 *id;
46 u32 ids;
47
48
49 int nr_members;
50 bool system_wide;
51 };
52
53 int perf_evsel__alloc_fd(struct perf_evsel *evsel, int ncpus, int nthreads);
54 void perf_evsel__close_fd(struct perf_evsel *evsel);
55 void perf_evsel__free_fd(struct perf_evsel *evsel);
56 int perf_evsel__read_size(struct perf_evsel *evsel);
57 int perf_evsel__apply_filter(struct perf_evsel *evsel, const char *filter);
58
59 int perf_evsel__alloc_id(struct perf_evsel *evsel, int ncpus, int nthreads);
60 void perf_evsel__free_id(struct perf_evsel *evsel);
61
62 #endif