aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/evsel.h
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2011-01-12 14:03:24 -0500
committerArnaldo Carvalho de Melo <acme@redhat.com>2011-01-22 16:56:29 -0500
commit70082dd92c4b288bd723a77897e2b555f0e63113 (patch)
tree907a2d78fcaabc28cd4d034901e0eac800d1ed17 /tools/perf/util/evsel.h
parentdd7927f4f8ee75b032ff15aeef4bda49719a443a (diff)
perf evsel: Introduce mmap support
Out of the code in 'perf top'. Record is next in line. Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Mike Galbraith <efault@gmx.de> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Cc: Tom Zanussi <tzanussi@gmail.com> LKML-Reference: <new-submission> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/evsel.h')
-rw-r--r--tools/perf/util/evsel.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h
index 1594696bd127..c8fbef299436 100644
--- a/tools/perf/util/evsel.h
+++ b/tools/perf/util/evsel.h
@@ -29,19 +29,23 @@ struct perf_evsel {
29 struct perf_event_attr attr; 29 struct perf_event_attr attr;
30 char *filter; 30 char *filter;
31 struct xyarray *fd; 31 struct xyarray *fd;
32 struct xyarray *mmap;
32 struct perf_counts *counts; 33 struct perf_counts *counts;
34 size_t mmap_len;
33 int idx; 35 int idx;
34 void *priv; 36 void *priv;
35}; 37};
36 38
37struct cpu_map; 39struct cpu_map;
38struct thread_map; 40struct thread_map;
41struct perf_evlist;
39 42
40struct perf_evsel *perf_evsel__new(struct perf_event_attr *attr, int idx); 43struct perf_evsel *perf_evsel__new(struct perf_event_attr *attr, int idx);
41void perf_evsel__delete(struct perf_evsel *evsel); 44void perf_evsel__delete(struct perf_evsel *evsel);
42 45
43int perf_evsel__alloc_fd(struct perf_evsel *evsel, int ncpus, int nthreads); 46int perf_evsel__alloc_fd(struct perf_evsel *evsel, int ncpus, int nthreads);
44int perf_evsel__alloc_counts(struct perf_evsel *evsel, int ncpus); 47int perf_evsel__alloc_counts(struct perf_evsel *evsel, int ncpus);
48int perf_evsel__alloc_mmap(struct perf_evsel *evsel, int ncpus, int nthreads);
45void perf_evsel__free_fd(struct perf_evsel *evsel); 49void perf_evsel__free_fd(struct perf_evsel *evsel);
46void perf_evsel__close_fd(struct perf_evsel *evsel, int ncpus, int nthreads); 50void perf_evsel__close_fd(struct perf_evsel *evsel, int ncpus, int nthreads);
47 51
@@ -51,6 +55,10 @@ int perf_evsel__open_per_thread(struct perf_evsel *evsel,
51 struct thread_map *threads, bool group, bool inherit); 55 struct thread_map *threads, bool group, bool inherit);
52int perf_evsel__open(struct perf_evsel *evsel, struct cpu_map *cpus, 56int perf_evsel__open(struct perf_evsel *evsel, struct cpu_map *cpus,
53 struct thread_map *threads, bool group, bool inherit); 57 struct thread_map *threads, bool group, bool inherit);
58int perf_evsel__mmap(struct perf_evsel *evsel, struct cpu_map *cpus,
59 struct thread_map *threads, int pages,
60 struct perf_evlist *evlist);
61void perf_evsel__munmap(struct perf_evsel *evsel, int ncpus, int nthreads);
54 62
55#define perf_evsel__match(evsel, t, c) \ 63#define perf_evsel__match(evsel, t, c) \
56 (evsel->attr.type == PERF_TYPE_##t && \ 64 (evsel->attr.type == PERF_TYPE_##t && \