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>
This commit is contained in:
Arnaldo Carvalho de Melo
2009-11-27 16:29:22 -02:00
committed by Ingo Molnar
parent 1de8e24520
commit 62daacb51a
16 changed files with 183 additions and 425 deletions

View File

@ -80,6 +80,13 @@ typedef union event_union {
struct sample_event sample;
} event_t;
struct events_stats {
unsigned long total;
unsigned long lost;
};
void event__print_totals(void);
enum map_type {
MAP__FUNCTION = 0,
@ -135,4 +142,14 @@ void map__fixup_end(struct map *self);
int event__synthesize_thread(pid_t pid, int (*process)(event_t *event));
void event__synthesize_threads(int (*process)(event_t *event));
extern char *event__cwd;
extern int event__cwdlen;
extern struct events_stats event__stats;
extern unsigned long event__total[PERF_RECORD_MAX];
int event__process_comm(event_t *self);
int event__process_lost(event_t *self);
int event__process_mmap(event_t *self);
int event__process_task(event_t *self);
#endif /* __PERF_RECORD_H */