diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2011-01-12 19:39:13 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2011-01-22 16:56:29 -0500 |
commit | 70db7533caef02350ec8d6852e589491bca3a951 (patch) | |
tree | 463dadbec60d585cb8c1de84b230378010d5c8b5 /tools/perf/util/evlist.h | |
parent | 115d2d8963a426670ac3ce983fc4c4e001703943 (diff) |
perf evlist: Move the mmap array from perf_evsel
Adopting the new model used in 'perf record', where we don't have a map
per thread per cpu, instead we have an mmap per cpu, established on the
first fd for that cpu and ask the kernel using the
PERF_EVENT_IOC_SET_OUTPUT ioctl to send events for the other fds on that
cpu for the one with the mmap.
The methods moved from perf_evsel to perf_evlist, but for easing review
they were modified in place, in evsel.c, the next patch will move the
migrated methods to evlist.c.
With this 'perf top' now uses the same mmap model used by 'perf record'
and the next patches will make 'perf record' use these new routines,
establishing a common codebase for both tools.
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/evlist.h')
-rw-r--r-- | tools/perf/util/evlist.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tools/perf/util/evlist.h b/tools/perf/util/evlist.h index 16bbfcba8ca8..dbfcc79bb995 100644 --- a/tools/perf/util/evlist.h +++ b/tools/perf/util/evlist.h | |||
@@ -2,13 +2,20 @@ | |||
2 | #define __PERF_EVLIST_H 1 | 2 | #define __PERF_EVLIST_H 1 |
3 | 3 | ||
4 | #include <linux/list.h> | 4 | #include <linux/list.h> |
5 | #include "../perf.h" | ||
5 | 6 | ||
6 | struct pollfd; | 7 | struct pollfd; |
7 | 8 | ||
9 | #define PERF_EVLIST__HLIST_BITS 8 | ||
10 | #define PERF_EVLIST__HLIST_SIZE (1 << PERF_EVLIST__HLIST_BITS) | ||
11 | |||
8 | struct perf_evlist { | 12 | struct perf_evlist { |
9 | struct list_head entries; | 13 | struct list_head entries; |
14 | struct hlist_head heads[PERF_EVLIST__HLIST_SIZE]; | ||
10 | int nr_entries; | 15 | int nr_entries; |
11 | int nr_fds; | 16 | int nr_fds; |
17 | int mmap_len; | ||
18 | struct perf_mmap *mmap; | ||
12 | struct pollfd *pollfd; | 19 | struct pollfd *pollfd; |
13 | }; | 20 | }; |
14 | 21 | ||
@@ -23,4 +30,6 @@ int perf_evlist__add_default(struct perf_evlist *evlist); | |||
23 | int perf_evlist__alloc_pollfd(struct perf_evlist *evlist, int ncpus, int nthreads); | 30 | int perf_evlist__alloc_pollfd(struct perf_evlist *evlist, int ncpus, int nthreads); |
24 | void perf_evlist__add_pollfd(struct perf_evlist *evlist, int fd); | 31 | void perf_evlist__add_pollfd(struct perf_evlist *evlist, int fd); |
25 | 32 | ||
33 | struct perf_evsel *perf_evlist__id2evsel(struct perf_evlist *evlist, u64 id); | ||
34 | |||
26 | #endif /* __PERF_EVLIST_H */ | 35 | #endif /* __PERF_EVLIST_H */ |