diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2009-11-27 13:29:22 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-11-27 14:22:01 -0500 |
commit | 62daacb51a2bf8480e6f6b3696b03f102fc15eb0 (patch) | |
tree | 5b9ed87005a5e59bcc95dd9a42e3d09d6481362d /tools/perf/util/event.h | |
parent | 1de8e24520ffdcf2a90c842eed937f59079a2abd (diff) |
perf tools: Reorganize event processing routines, lotsa dups killed
While implementing event__preprocess_sample, that will do all of
the symbol lookup in one convenient function, I noticed that
util/process_event.[ch] were not being used at all, then started
looking if there were other functions that could be shared
and...
All those functions really don't need to receive offset + head,
the only thing they did was common to all of them, so do it at
one place instead.
Stats about number of each type of event processed now is done
in a central place.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frédéric Weisbecker <fweisbec@gmail.com>
Cc: John Kacur <jkacur@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
LKML-Reference: <1259346563-12568-11-git-send-email-acme@infradead.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf/util/event.h')
-rw-r--r-- | tools/perf/util/event.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tools/perf/util/event.h b/tools/perf/util/event.h index 3ae3c964c901..13c12c75f970 100644 --- a/tools/perf/util/event.h +++ b/tools/perf/util/event.h | |||
@@ -80,6 +80,13 @@ typedef union event_union { | |||
80 | struct sample_event sample; | 80 | struct sample_event sample; |
81 | } event_t; | 81 | } event_t; |
82 | 82 | ||
83 | struct events_stats { | ||
84 | unsigned long total; | ||
85 | unsigned long lost; | ||
86 | }; | ||
87 | |||
88 | void event__print_totals(void); | ||
89 | |||
83 | enum map_type { | 90 | enum map_type { |
84 | MAP__FUNCTION = 0, | 91 | MAP__FUNCTION = 0, |
85 | 92 | ||
@@ -135,4 +142,14 @@ void map__fixup_end(struct map *self); | |||
135 | int event__synthesize_thread(pid_t pid, int (*process)(event_t *event)); | 142 | int event__synthesize_thread(pid_t pid, int (*process)(event_t *event)); |
136 | void event__synthesize_threads(int (*process)(event_t *event)); | 143 | void event__synthesize_threads(int (*process)(event_t *event)); |
137 | 144 | ||
145 | extern char *event__cwd; | ||
146 | extern int event__cwdlen; | ||
147 | extern struct events_stats event__stats; | ||
148 | extern unsigned long event__total[PERF_RECORD_MAX]; | ||
149 | |||
150 | int event__process_comm(event_t *self); | ||
151 | int event__process_lost(event_t *self); | ||
152 | int event__process_mmap(event_t *self); | ||
153 | int event__process_task(event_t *self); | ||
154 | |||
138 | #endif /* __PERF_RECORD_H */ | 155 | #endif /* __PERF_RECORD_H */ |