diff options
Diffstat (limited to 'tools/perf/util/evsel.h')
-rw-r--r-- | tools/perf/util/evsel.h | 33 |
1 files changed, 29 insertions, 4 deletions
diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h index b2d755fe88a5..7962e7587dea 100644 --- a/tools/perf/util/evsel.h +++ b/tools/perf/util/evsel.h | |||
@@ -24,11 +24,24 @@ struct perf_counts { | |||
24 | struct perf_counts_values cpu[]; | 24 | struct perf_counts_values cpu[]; |
25 | }; | 25 | }; |
26 | 26 | ||
27 | struct perf_evsel; | ||
28 | |||
29 | /* | ||
30 | * Per fd, to map back from PERF_SAMPLE_ID to evsel, only used when there are | ||
31 | * more than one entry in the evlist. | ||
32 | */ | ||
33 | struct perf_sample_id { | ||
34 | struct hlist_node node; | ||
35 | u64 id; | ||
36 | struct perf_evsel *evsel; | ||
37 | }; | ||
38 | |||
27 | struct perf_evsel { | 39 | struct perf_evsel { |
28 | struct list_head node; | 40 | struct list_head node; |
29 | struct perf_event_attr attr; | 41 | struct perf_event_attr attr; |
30 | char *filter; | 42 | char *filter; |
31 | struct xyarray *fd; | 43 | struct xyarray *fd; |
44 | struct xyarray *id; | ||
32 | struct perf_counts *counts; | 45 | struct perf_counts *counts; |
33 | int idx; | 46 | int idx; |
34 | void *priv; | 47 | void *priv; |
@@ -36,19 +49,31 @@ struct perf_evsel { | |||
36 | 49 | ||
37 | struct cpu_map; | 50 | struct cpu_map; |
38 | struct thread_map; | 51 | struct thread_map; |
52 | struct perf_evlist; | ||
39 | 53 | ||
40 | struct perf_evsel *perf_evsel__new(struct perf_event_attr *attr, int idx); | 54 | struct perf_evsel *perf_evsel__new(struct perf_event_attr *attr, int idx); |
55 | void perf_evsel__init(struct perf_evsel *evsel, | ||
56 | struct perf_event_attr *attr, int idx); | ||
57 | void perf_evsel__exit(struct perf_evsel *evsel); | ||
41 | void perf_evsel__delete(struct perf_evsel *evsel); | 58 | void perf_evsel__delete(struct perf_evsel *evsel); |
42 | 59 | ||
43 | int perf_evsel__alloc_fd(struct perf_evsel *evsel, int ncpus, int nthreads); | 60 | int perf_evsel__alloc_fd(struct perf_evsel *evsel, int ncpus, int nthreads); |
61 | int perf_evsel__alloc_id(struct perf_evsel *evsel, int ncpus, int nthreads); | ||
44 | int perf_evsel__alloc_counts(struct perf_evsel *evsel, int ncpus); | 62 | int perf_evsel__alloc_counts(struct perf_evsel *evsel, int ncpus); |
63 | int perf_evlist__alloc_mmap(struct perf_evlist *evlist, int ncpus); | ||
45 | void perf_evsel__free_fd(struct perf_evsel *evsel); | 64 | void perf_evsel__free_fd(struct perf_evsel *evsel); |
65 | void perf_evsel__free_id(struct perf_evsel *evsel); | ||
46 | void perf_evsel__close_fd(struct perf_evsel *evsel, int ncpus, int nthreads); | 66 | void perf_evsel__close_fd(struct perf_evsel *evsel, int ncpus, int nthreads); |
47 | 67 | ||
48 | int perf_evsel__open_per_cpu(struct perf_evsel *evsel, struct cpu_map *cpus); | 68 | int perf_evsel__open_per_cpu(struct perf_evsel *evsel, |
49 | int perf_evsel__open_per_thread(struct perf_evsel *evsel, struct thread_map *threads); | 69 | struct cpu_map *cpus, bool group, bool inherit); |
50 | int perf_evsel__open(struct perf_evsel *evsel, | 70 | int perf_evsel__open_per_thread(struct perf_evsel *evsel, |
51 | struct cpu_map *cpus, struct thread_map *threads); | 71 | struct thread_map *threads, bool group, bool inherit); |
72 | int perf_evsel__open(struct perf_evsel *evsel, struct cpu_map *cpus, | ||
73 | struct thread_map *threads, bool group, bool inherit); | ||
74 | int perf_evlist__mmap(struct perf_evlist *evlist, struct cpu_map *cpus, | ||
75 | struct thread_map *threads, int pages, bool overwrite); | ||
76 | void perf_evlist__munmap(struct perf_evlist *evlist, int ncpus); | ||
52 | 77 | ||
53 | #define perf_evsel__match(evsel, t, c) \ | 78 | #define perf_evsel__match(evsel, t, c) \ |
54 | (evsel->attr.type == PERF_TYPE_##t && \ | 79 | (evsel->attr.type == PERF_TYPE_##t && \ |