diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2015-03-31 08:53:50 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2015-03-31 16:52:31 -0400 |
commit | aae59fab978e143f24d22e52f075c4be3ee4e628 (patch) | |
tree | 0615f06961f8cfffe302b37d64359a793b550ab9 /tools | |
parent | ca6c41c59b964d362823e80442e9e32c31106b29 (diff) |
perf session: Always initialize ordered_events
Even when it is not used to actually reorder events, some of its fields
are used, like session->ordered_events->tool, to shorten function
signatures where tool, for instance, was being passed, as the tool is
needed for the ordered_events code, we need it there and might as well
use it for other perf_session needs.
This fixes a problem where 'perf script' had some condition that made
session->ordered_events not to be initialized even with its
script->tool ordered_events related flags asking for it to be, which
looks like another bug and needs to be investigated further.
Always initializing session->ordered_events at least leaves the current
assumptions in place, so do it now.
Reported-by: David Ahern <dsahern@gmail.com>
Reviewed-by: David Ahern <dsahern@gmail.com>
Tested-by: David Ahern <dsahern@gmail.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: Don Zickus <dzickus@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-b1xxk0rwkz2a0gip1uufmjqg@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/util/session.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c index adf0740c563b..89c66797abe4 100644 --- a/tools/perf/util/session.c +++ b/tools/perf/util/session.c | |||
@@ -110,6 +110,8 @@ struct perf_session *perf_session__new(struct perf_data_file *file, | |||
110 | 110 | ||
111 | session->repipe = repipe; | 111 | session->repipe = repipe; |
112 | machines__init(&session->machines); | 112 | machines__init(&session->machines); |
113 | ordered_events__init(&session->ordered_events, &session->machines, | ||
114 | session->evlist, tool, ordered_events__deliver_event); | ||
113 | 115 | ||
114 | if (file) { | 116 | if (file) { |
115 | if (perf_data_file__open(file)) | 117 | if (perf_data_file__open(file)) |
@@ -139,9 +141,6 @@ struct perf_session *perf_session__new(struct perf_data_file *file, | |||
139 | tool->ordered_events && !perf_evlist__sample_id_all(session->evlist)) { | 141 | tool->ordered_events && !perf_evlist__sample_id_all(session->evlist)) { |
140 | dump_printf("WARNING: No sample_id_all support, falling back to unordered processing\n"); | 142 | dump_printf("WARNING: No sample_id_all support, falling back to unordered processing\n"); |
141 | tool->ordered_events = false; | 143 | tool->ordered_events = false; |
142 | } else { | ||
143 | ordered_events__init(&session->ordered_events, &session->machines, | ||
144 | session->evlist, tool, ordered_events__deliver_event); | ||
145 | } | 144 | } |
146 | 145 | ||
147 | return session; | 146 | return session; |