aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2012-08-01 18:25:26 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2012-08-01 18:25:26 -0400
commit5e5624745d7e4a2c956c072ef2542872955b59c4 (patch)
treeae2ad96423392f7e40b0e81f811a824390847e49 /tools
parent7f3be652c1a8866251bfba9ea8b02067328f5db9 (diff)
perf session: Use perf_evlist__sample_id_all more extensively
Removing perf_session->sample_id_all, as it can be obtained from the evsel/evlist. Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-ok58u1mlc5ci9b6p36r52uh1@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/perf/util/session.c9
-rw-r--r--tools/perf/util/session.h1
2 files changed, 4 insertions, 6 deletions
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index 00e180e116e7..348cc11385b7 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -25,7 +25,7 @@ int perf_session__parse_sample(struct perf_session *session,
25 25
26 return perf_event__parse_sample(event, first->attr.sample_type, 26 return perf_event__parse_sample(event, first->attr.sample_type,
27 first->sample_size, 27 first->sample_size,
28 session->sample_id_all, sample, 28 first->attr.sample_id_all, sample,
29 session->header.needs_swap); 29 session->header.needs_swap);
30} 30}
31 31
@@ -103,7 +103,6 @@ out_close:
103 103
104void perf_session__update_sample_type(struct perf_session *self) 104void perf_session__update_sample_type(struct perf_session *self)
105{ 105{
106 self->sample_id_all = perf_evlist__sample_id_all(self->evlist);
107 self->id_hdr_size = perf_evlist__id_hdr_size(self->evlist); 106 self->id_hdr_size = perf_evlist__id_hdr_size(self->evlist);
108 self->host_machine.id_hdr_size = self->id_hdr_size; 107 self->host_machine.id_hdr_size = self->id_hdr_size;
109 machines__set_id_hdr_size(&self->machines, self->id_hdr_size); 108 machines__set_id_hdr_size(&self->machines, self->id_hdr_size);
@@ -177,7 +176,7 @@ struct perf_session *perf_session__new(const char *filename, int mode,
177 } 176 }
178 177
179 if (tool && tool->ordering_requires_timestamps && 178 if (tool && tool->ordering_requires_timestamps &&
180 tool->ordered_samples && !self->sample_id_all) { 179 tool->ordered_samples && !perf_evlist__sample_id_all(self->evlist)) {
181 dump_printf("WARNING: No sample_id_all support, falling back to unordered processing\n"); 180 dump_printf("WARNING: No sample_id_all support, falling back to unordered processing\n");
182 tool->ordered_samples = false; 181 tool->ordered_samples = false;
183 } 182 }
@@ -887,7 +886,7 @@ static void perf_session__print_tstamp(struct perf_session *session,
887 u64 sample_type = perf_evlist__sample_type(session->evlist); 886 u64 sample_type = perf_evlist__sample_type(session->evlist);
888 887
889 if (event->header.type != PERF_RECORD_SAMPLE && 888 if (event->header.type != PERF_RECORD_SAMPLE &&
890 !session->sample_id_all) { 889 !perf_evlist__sample_id_all(session->evlist)) {
891 fputs("-1 -1 ", stdout); 890 fputs("-1 -1 ", stdout);
892 return; 891 return;
893 } 892 }
@@ -1090,7 +1089,7 @@ static int perf_session__process_event(struct perf_session *session,
1090 int ret; 1089 int ret;
1091 1090
1092 if (session->header.needs_swap) 1091 if (session->header.needs_swap)
1093 event_swap(event, session->sample_id_all); 1092 event_swap(event, perf_evlist__sample_id_all(session->evlist));
1094 1093
1095 if (event->header.type >= PERF_RECORD_HEADER_MAX) 1094 if (event->header.type >= PERF_RECORD_HEADER_MAX)
1096 return -EINVAL; 1095 return -EINVAL;
diff --git a/tools/perf/util/session.h b/tools/perf/util/session.h
index c45ce4348b83..a2c3ce9e716d 100644
--- a/tools/perf/util/session.h
+++ b/tools/perf/util/session.h
@@ -44,7 +44,6 @@ struct perf_session {
44 int fd; 44 int fd;
45 bool fd_pipe; 45 bool fd_pipe;
46 bool repipe; 46 bool repipe;
47 bool sample_id_all;
48 u16 id_hdr_size; 47 u16 id_hdr_size;
49 int cwdlen; 48 int cwdlen;
50 char *cwd; 49 char *cwd;