aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/evsel.h
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/util/evsel.h')
-rw-r--r--tools/perf/util/evsel.h33
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
27struct 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 */
33struct perf_sample_id {
34 struct hlist_node node;
35 u64 id;
36 struct perf_evsel *evsel;
37};
38
27struct perf_evsel { 39struct 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
37struct cpu_map; 50struct cpu_map;
38struct thread_map; 51struct thread_map;
52struct perf_evlist;
39 53
40struct perf_evsel *perf_evsel__new(struct perf_event_attr *attr, int idx); 54struct perf_evsel *perf_evsel__new(struct perf_event_attr *attr, int idx);
55void perf_evsel__init(struct perf_evsel *evsel,
56 struct perf_event_attr *attr, int idx);
57void perf_evsel__exit(struct perf_evsel *evsel);
41void perf_evsel__delete(struct perf_evsel *evsel); 58void perf_evsel__delete(struct perf_evsel *evsel);
42 59
43int perf_evsel__alloc_fd(struct perf_evsel *evsel, int ncpus, int nthreads); 60int perf_evsel__alloc_fd(struct perf_evsel *evsel, int ncpus, int nthreads);
61int perf_evsel__alloc_id(struct perf_evsel *evsel, int ncpus, int nthreads);
44int perf_evsel__alloc_counts(struct perf_evsel *evsel, int ncpus); 62int perf_evsel__alloc_counts(struct perf_evsel *evsel, int ncpus);
63int perf_evlist__alloc_mmap(struct perf_evlist *evlist, int ncpus);
45void perf_evsel__free_fd(struct perf_evsel *evsel); 64void perf_evsel__free_fd(struct perf_evsel *evsel);
65void perf_evsel__free_id(struct perf_evsel *evsel);
46void perf_evsel__close_fd(struct perf_evsel *evsel, int ncpus, int nthreads); 66void perf_evsel__close_fd(struct perf_evsel *evsel, int ncpus, int nthreads);
47 67
48int perf_evsel__open_per_cpu(struct perf_evsel *evsel, struct cpu_map *cpus); 68int perf_evsel__open_per_cpu(struct perf_evsel *evsel,
49int perf_evsel__open_per_thread(struct perf_evsel *evsel, struct thread_map *threads); 69 struct cpu_map *cpus, bool group, bool inherit);
50int perf_evsel__open(struct perf_evsel *evsel, 70int 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);
72int perf_evsel__open(struct perf_evsel *evsel, struct cpu_map *cpus,
73 struct thread_map *threads, bool group, bool inherit);
74int perf_evlist__mmap(struct perf_evlist *evlist, struct cpu_map *cpus,
75 struct thread_map *threads, int pages, bool overwrite);
76void 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 && \