Skip to content

Commit

Permalink
perf session: Use perf_evlist__sample_id_all more extensively
Browse files Browse the repository at this point in the history
Removing perf_session->sample_id_all, as it can be obtained from the
evsel/evlist.

Cc: David Ahern <[email protected]>
Cc: Frederic Weisbecker <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Mike Galbraith <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Stephane Eranian <[email protected]>
Link: http://lkml.kernel.org/n/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
  • Loading branch information
acmel committed Aug 1, 2012
1 parent 7f3be65 commit 5e56247
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
9 changes: 4 additions & 5 deletions tools/perf/util/session.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ int perf_session__parse_sample(struct perf_session *session,

return perf_event__parse_sample(event, first->attr.sample_type,
first->sample_size,
session->sample_id_all, sample,
first->attr.sample_id_all, sample,
session->header.needs_swap);
}

Expand Down Expand Up @@ -103,7 +103,6 @@ static int perf_session__open(struct perf_session *self, bool force)

void perf_session__update_sample_type(struct perf_session *self)
{
self->sample_id_all = perf_evlist__sample_id_all(self->evlist);
self->id_hdr_size = perf_evlist__id_hdr_size(self->evlist);
self->host_machine.id_hdr_size = self->id_hdr_size;
machines__set_id_hdr_size(&self->machines, self->id_hdr_size);
Expand Down Expand Up @@ -177,7 +176,7 @@ struct perf_session *perf_session__new(const char *filename, int mode,
}

if (tool && tool->ordering_requires_timestamps &&
tool->ordered_samples && !self->sample_id_all) {
tool->ordered_samples && !perf_evlist__sample_id_all(self->evlist)) {
dump_printf("WARNING: No sample_id_all support, falling back to unordered processing\n");
tool->ordered_samples = false;
}
Expand Down Expand Up @@ -887,7 +886,7 @@ static void perf_session__print_tstamp(struct perf_session *session,
u64 sample_type = perf_evlist__sample_type(session->evlist);

if (event->header.type != PERF_RECORD_SAMPLE &&
!session->sample_id_all) {
!perf_evlist__sample_id_all(session->evlist)) {
fputs("-1 -1 ", stdout);
return;
}
Expand Down Expand Up @@ -1090,7 +1089,7 @@ static int perf_session__process_event(struct perf_session *session,
int ret;

if (session->header.needs_swap)
event_swap(event, session->sample_id_all);
event_swap(event, perf_evlist__sample_id_all(session->evlist));

if (event->header.type >= PERF_RECORD_HEADER_MAX)
return -EINVAL;
Expand Down
1 change: 0 additions & 1 deletion tools/perf/util/session.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ struct perf_session {
int fd;
bool fd_pipe;
bool repipe;
bool sample_id_all;
u16 id_hdr_size;
int cwdlen;
char *cwd;
Expand Down

0 comments on commit 5e56247

Please sign in to comment.