aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/session.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/session.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/session.h')
-rw-r--r--tools/perf/util/session.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/tools/perf/util/session.h b/tools/perf/util/session.h
index 5bf6efa3788a..4578f86a6209 100644
--- a/tools/perf/util/session.h
+++ b/tools/perf/util/session.h
@@ -54,7 +54,9 @@ struct perf_session {
54 54
55struct perf_event_ops; 55struct perf_event_ops;
56 56
57typedef int (*event_op)(event_t *self, struct perf_session *session); 57typedef int (*event_op)(event_t *self, struct sample_data *sample,
58 struct perf_session *session);
59typedef int (*event_synth_op)(event_t *self, struct perf_session *session);
58typedef int (*event_op2)(event_t *self, struct perf_session *session, 60typedef int (*event_op2)(event_t *self, struct perf_session *session,
59 struct perf_event_ops *ops); 61 struct perf_event_ops *ops);
60 62
@@ -67,8 +69,8 @@ struct perf_event_ops {
67 lost, 69 lost,
68 read, 70 read,
69 throttle, 71 throttle,
70 unthrottle, 72 unthrottle;
71 attr, 73 event_synth_op attr,
72 event_type, 74 event_type,
73 tracing_data, 75 tracing_data,
74 build_id; 76 build_id;
@@ -104,6 +106,7 @@ int perf_session__create_kernel_maps(struct perf_session *self);
104 106
105int do_read(int fd, void *buf, size_t size); 107int do_read(int fd, void *buf, size_t size);
106void perf_session__update_sample_type(struct perf_session *self); 108void perf_session__update_sample_type(struct perf_session *self);
109void perf_session__set_sample_type(struct perf_session *session, u64 type);
107void perf_session__remove_thread(struct perf_session *self, struct thread *th); 110void perf_session__remove_thread(struct perf_session *self, struct thread *th);
108 111
109static inline 112static inline