diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2011-11-25 08:19:45 -0200 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2011-11-28 10:38:56 -0200 |
commit | d20deb64e0490ee9442b5181bc08a62d2cadcb90 (patch) | |
tree | afdb3f6fc9abbce9d0a96b7049d1f8121178a356 /tools/perf/util/event.h | |
parent | 7009cc34b964939815160d7de64cf0215cdbf8bb (diff) | |
download | blackbird-op-linux-d20deb64e0490ee9442b5181bc08a62d2cadcb90.tar.gz blackbird-op-linux-d20deb64e0490ee9442b5181bc08a62d2cadcb90.zip |
perf tools: Pass tool context in the the perf_event_ops functions
So that we don't need to have that many globals.
Next steps will remove the 'session' pointer, that in most cases is
not needed.
Then we can rename perf_event_ops to 'perf_tool' that better describes
this class hierarchy.
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-wp4djox7x6w1i2bab1pt4xxp@git.kernel.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.h | 38 |
1 files changed, 26 insertions, 12 deletions
diff --git a/tools/perf/util/event.h b/tools/perf/util/event.h index 357a85b85248..669409d35710 100644 --- a/tools/perf/util/event.h +++ b/tools/perf/util/event.h @@ -141,38 +141,52 @@ union perf_event { void perf_event__print_totals(void); +struct perf_event_ops; struct perf_session; struct thread_map; -typedef int (*perf_event__handler_synth_t)(union perf_event *event, - struct perf_session *session); -typedef int (*perf_event__handler_t)(union perf_event *event, +typedef int (*perf_event__handler_t)(struct perf_event_ops *ops, + union perf_event *event, struct perf_sample *sample, struct perf_session *session); -int perf_event__synthesize_thread_map(struct thread_map *threads, +int perf_event__synthesize_thread_map(struct perf_event_ops *ops, + struct thread_map *threads, perf_event__handler_t process, struct perf_session *session); -int perf_event__synthesize_threads(perf_event__handler_t process, +int perf_event__synthesize_threads(struct perf_event_ops *ops, + perf_event__handler_t process, struct perf_session *session); -int perf_event__synthesize_kernel_mmap(perf_event__handler_t process, +int perf_event__synthesize_kernel_mmap(struct perf_event_ops *ops, + perf_event__handler_t process, struct perf_session *session, struct machine *machine, const char *symbol_name); -int perf_event__synthesize_modules(perf_event__handler_t process, +int perf_event__synthesize_modules(struct perf_event_ops *ops, + perf_event__handler_t process, struct perf_session *session, struct machine *machine); -int perf_event__process_comm(union perf_event *event, struct perf_sample *sample, +int perf_event__process_comm(struct perf_event_ops *ops, + union perf_event *event, + struct perf_sample *sample, struct perf_session *session); -int perf_event__process_lost(union perf_event *event, struct perf_sample *sample, +int perf_event__process_lost(struct perf_event_ops *ops, + union perf_event *event, + struct perf_sample *sample, struct perf_session *session); -int perf_event__process_mmap(union perf_event *event, struct perf_sample *sample, +int perf_event__process_mmap(struct perf_event_ops *ops, + union perf_event *event, + struct perf_sample *sample, struct perf_session *session); -int perf_event__process_task(union perf_event *event, struct perf_sample *sample, +int perf_event__process_task(struct perf_event_ops *ops, + union perf_event *event, + struct perf_sample *sample, struct perf_session *session); -int perf_event__process(union perf_event *event, struct perf_sample *sample, +int perf_event__process(struct perf_event_ops *ops, + union perf_event *event, + struct perf_sample *sample, struct perf_session *session); struct addr_location; |