perf evlist: Steal mmap reading routine from 'perf top'

Will be used in the upcoming 'perf test' entry for the evlist mmap
routines.

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>
This commit is contained in:
Arnaldo Carvalho de Melo
2011-01-15 10:40:59 -02:00
parent 98d77b7850
commit 04391debc3
3 changed files with 69 additions and 53 deletions

View File

@@ -3,6 +3,7 @@
#include <linux/list.h>
#include "../perf.h"
#include "event.h"
struct pollfd;
@@ -15,6 +16,7 @@ struct perf_evlist {
int nr_entries;
int nr_fds;
int mmap_len;
event_t event_copy;
struct perf_mmap *mmap;
struct pollfd *pollfd;
};
@@ -32,4 +34,6 @@ void perf_evlist__add_pollfd(struct perf_evlist *evlist, int fd);
struct perf_evsel *perf_evlist__id2evsel(struct perf_evlist *evlist, u64 id);
event_t *perf_evlist__read_on_cpu(struct perf_evlist *self, int cpu);
#endif /* __PERF_EVLIST_H */