perf session: Adopt the sample_type variable

All tools had copies, and perf diff would have to specify a
sample_type_check method just for copying it.

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: <1260807780-19377-2-git-send-email-acme@infradead.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
Arnaldo Carvalho de Melo
2009-12-14 14:23:00 -02:00
committed by Ingo Molnar
parent a328626b61
commit c019879bcc
7 changed files with 34 additions and 58 deletions

View File

@@ -144,7 +144,6 @@ int perf_session__process_events(struct perf_session *self,
unsigned long head, shift;
unsigned long offset = 0;
size_t page_size;
u64 sample_type;
event_t *event;
uint32_t size;
char *buf;
@@ -157,11 +156,10 @@ int perf_session__process_events(struct perf_session *self,
page_size = getpagesize();
head = self->header.data_offset;
sample_type = perf_header__sample_type(&self->header);
self->sample_type = perf_header__sample_type(&self->header);
err = -EINVAL;
if (ops->sample_type_check &&
ops->sample_type_check(sample_type, self) < 0)
if (ops->sample_type_check && ops->sample_type_check(self) < 0)
goto out_err;
if (!ops->full_paths) {