Commit | Line | Data |
---|---|---|
69aad6f1 ACM |
1 | #ifndef __PERF_EVSEL_H |
2 | #define __PERF_EVSEL_H 1 | |
3 | ||
4 | #include <linux/list.h> | |
5 | #include <linux/perf_event.h> | |
6 | #include "types.h" | |
7 | #include "xyarray.h" | |
8 | ||
9 | struct perf_evsel { | |
10 | struct list_head node; | |
11 | struct perf_event_attr attr; | |
12 | char *filter; | |
13 | struct xyarray *fd; | |
14 | int idx; | |
15 | void *priv; | |
16 | }; | |
17 | ||
18 | struct perf_evsel *perf_evsel__new(u32 type, u64 config, int idx); | |
19 | void perf_evsel__delete(struct perf_evsel *evsel); | |
20 | ||
21 | int perf_evsel__alloc_fd(struct perf_evsel *evsel, int ncpus, int nthreads); | |
22 | void perf_evsel__free_fd(struct perf_evsel *evsel); | |
23 | ||
daec78a0 ACM |
24 | #define perf_evsel__match(evsel, t, c) \ |
25 | (evsel->attr.type == PERF_TYPE_##t && \ | |
26 | evsel->attr.config == PERF_COUNT_##c) | |
27 | ||
69aad6f1 | 28 | #endif /* __PERF_EVSEL_H */ |