diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2009-12-13 16:50:24 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-12-14 10:57:13 -0500 |
commit | d8f66248d6f25f7c935cc5307c43bf394db07272 (patch) | |
tree | f30b5512dd08e6a8713fa9fde158c75d57ce1d6b /tools/perf/util/data_map.c | |
parent | 2cd9046cc53dd2625e2cf5854d6cbb1ba61de914 (diff) |
perf session: Pass the perf_session to the event handling operations
They will need it to get the right threads list, etc.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frédéric Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
LKML-Reference: <1260741029-4430-1-git-send-email-acme@infradead.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf/util/data_map.c')
-rw-r--r-- | tools/perf/util/data_map.c | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/tools/perf/util/data_map.c b/tools/perf/util/data_map.c index 6d46dda53a29..22bcdfeff55c 100644 --- a/tools/perf/util/data_map.c +++ b/tools/perf/util/data_map.c | |||
@@ -8,7 +8,8 @@ static struct perf_file_handler *curr_handler; | |||
8 | static unsigned long mmap_window = 32; | 8 | static unsigned long mmap_window = 32; |
9 | static char __cwd[PATH_MAX]; | 9 | static char __cwd[PATH_MAX]; |
10 | 10 | ||
11 | static int process_event_stub(event_t *event __used) | 11 | static int process_event_stub(event_t *event __used, |
12 | struct perf_session *session __used) | ||
12 | { | 13 | { |
13 | dump_printf(": unhandled!\n"); | 14 | dump_printf(": unhandled!\n"); |
14 | return 0; | 15 | return 0; |
@@ -61,8 +62,8 @@ void event__print_totals(void) | |||
61 | event__name[i], event__total[i]); | 62 | event__name[i], event__total[i]); |
62 | } | 63 | } |
63 | 64 | ||
64 | static int | 65 | static int process_event(event_t *event, struct perf_session *session, |
65 | process_event(event_t *event, unsigned long offset, unsigned long head) | 66 | unsigned long offset, unsigned long head) |
66 | { | 67 | { |
67 | trace_event(event); | 68 | trace_event(event); |
68 | 69 | ||
@@ -77,23 +78,23 @@ process_event(event_t *event, unsigned long offset, unsigned long head) | |||
77 | 78 | ||
78 | switch (event->header.type) { | 79 | switch (event->header.type) { |
79 | case PERF_RECORD_SAMPLE: | 80 | case PERF_RECORD_SAMPLE: |
80 | return curr_handler->process_sample_event(event); | 81 | return curr_handler->process_sample_event(event, session); |
81 | case PERF_RECORD_MMAP: | 82 | case PERF_RECORD_MMAP: |
82 | return curr_handler->process_mmap_event(event); | 83 | return curr_handler->process_mmap_event(event, session); |
83 | case PERF_RECORD_COMM: | 84 | case PERF_RECORD_COMM: |
84 | return curr_handler->process_comm_event(event); | 85 | return curr_handler->process_comm_event(event, session); |
85 | case PERF_RECORD_FORK: | 86 | case PERF_RECORD_FORK: |
86 | return curr_handler->process_fork_event(event); | 87 | return curr_handler->process_fork_event(event, session); |
87 | case PERF_RECORD_EXIT: | 88 | case PERF_RECORD_EXIT: |
88 | return curr_handler->process_exit_event(event); | 89 | return curr_handler->process_exit_event(event, session); |
89 | case PERF_RECORD_LOST: | 90 | case PERF_RECORD_LOST: |
90 | return curr_handler->process_lost_event(event); | 91 | return curr_handler->process_lost_event(event, session); |
91 | case PERF_RECORD_READ: | 92 | case PERF_RECORD_READ: |
92 | return curr_handler->process_read_event(event); | 93 | return curr_handler->process_read_event(event, session); |
93 | case PERF_RECORD_THROTTLE: | 94 | case PERF_RECORD_THROTTLE: |
94 | return curr_handler->process_throttle_event(event); | 95 | return curr_handler->process_throttle_event(event, session); |
95 | case PERF_RECORD_UNTHROTTLE: | 96 | case PERF_RECORD_UNTHROTTLE: |
96 | return curr_handler->process_unthrottle_event(event); | 97 | return curr_handler->process_unthrottle_event(event, session); |
97 | default: | 98 | default: |
98 | curr_handler->total_unknown++; | 99 | curr_handler->total_unknown++; |
99 | return -1; | 100 | return -1; |
@@ -209,7 +210,7 @@ more: | |||
209 | (void *)(long)event->header.size, | 210 | (void *)(long)event->header.size, |
210 | event->header.type); | 211 | event->header.type); |
211 | 212 | ||
212 | if (!size || process_event(event, offset, head) < 0) { | 213 | if (!size || process_event(event, self, offset, head) < 0) { |
213 | 214 | ||
214 | dump_printf("%p [%p]: skipping unknown header type: %d\n", | 215 | dump_printf("%p [%p]: skipping unknown header type: %d\n", |
215 | (void *)(offset + head), | 216 | (void *)(offset + head), |