aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/event.h
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2010-12-02 11:10:21 -0500
committerArnaldo Carvalho de Melo <acme@redhat.com>2010-12-04 20:05:19 -0500
commit640c03ce837fe8d4b56342aba376ea0da3960459 (patch)
treee954290ccacf032ab4d9052eac01710fda1b7fab /tools/perf/util/event.h
parentc980d1091810df13f21aabbce545fd98f545bbf7 (diff)
perf session: Parse sample earlier
At perf_session__process_event, so that we reduce the number of lines in eache tool sample processing routine that now receives a sample_data pointer already parsed. This will also be useful in the next patch, where we'll allow sample the identity fields in MMAP, FORK, EXIT, etc, when it will be possible to see (cpu, timestamp) just after before every event. Also validate callchains in perf_session__process_event, i.e. as early as possible, and keep a counter of the number of events discarded due to invalid callchains, warning the user about it if it happens. There is an assumption that was kept that all events have the same sample_type, that will be dealt with in the future, when this preexisting limitation will be removed. Tested-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Ian Munsie <imunsie@au1.ibm.com> Acked-by: Thomas Gleixner <tglx@linutronix.de> Cc: Frédéric Weisbecker <fweisbec@gmail.com> Cc: Ian Munsie <imunsie@au1.ibm.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Paul Mackerras <paulus@samba.org> Cc: Stephane Eranian <eranian@google.com> LKML-Reference: <1291318772-30880-4-git-send-email-acme@infradead.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/event.h')
-rw-r--r--tools/perf/util/event.h20
1 files changed, 14 insertions, 6 deletions
diff --git a/tools/perf/util/event.h b/tools/perf/util/event.h
index 8e790dae7026..08c400b83d57 100644
--- a/tools/perf/util/event.h
+++ b/tools/perf/util/event.h
@@ -135,7 +135,10 @@ void event__print_totals(void);
135 135
136struct perf_session; 136struct perf_session;
137 137
138typedef int (*event__handler_t)(event_t *event, struct perf_session *session); 138typedef int (*event__handler_synth_t)(event_t *event,
139 struct perf_session *session);
140typedef int (*event__handler_t)(event_t *event, struct sample_data *sample,
141 struct perf_session *session);
139 142
140int event__synthesize_thread(pid_t pid, event__handler_t process, 143int event__synthesize_thread(pid_t pid, event__handler_t process,
141 struct perf_session *session); 144 struct perf_session *session);
@@ -150,11 +153,16 @@ int event__synthesize_modules(event__handler_t process,
150 struct perf_session *session, 153 struct perf_session *session,
151 struct machine *machine); 154 struct machine *machine);
152 155
153int event__process_comm(event_t *self, struct perf_session *session); 156int event__process_comm(event_t *self, struct sample_data *sample,
154int event__process_lost(event_t *self, struct perf_session *session); 157 struct perf_session *session);
155int event__process_mmap(event_t *self, struct perf_session *session); 158int event__process_lost(event_t *self, struct sample_data *sample,
156int event__process_task(event_t *self, struct perf_session *session); 159 struct perf_session *session);
157int event__process(event_t *event, struct perf_session *session); 160int event__process_mmap(event_t *self, struct sample_data *sample,
161 struct perf_session *session);
162int event__process_task(event_t *self, struct sample_data *sample,
163 struct perf_session *session);
164int event__process(event_t *event, struct sample_data *sample,
165 struct perf_session *session);
158 166
159struct addr_location; 167struct addr_location;
160int event__preprocess_sample(const event_t *self, struct perf_session *session, 168int event__preprocess_sample(const event_t *self, struct perf_session *session,