Skip to content

Commit aae59fa

Browse files
committed
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 <[email protected]> Reviewed-by: David Ahern <[email protected]> Tested-by: David Ahern <[email protected]> Cc: Adrian Hunter <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Don Zickus <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Stephane Eranian <[email protected]> Link: http://lkml.kernel.org/n/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent ca6c41c commit aae59fa

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

tools/perf/util/session.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ struct perf_session *perf_session__new(struct perf_data_file *file,
110110

111111
session->repipe = repipe;
112112
machines__init(&session->machines);
113+
ordered_events__init(&session->ordered_events, &session->machines,
114+
session->evlist, tool, ordered_events__deliver_event);
113115

114116
if (file) {
115117
if (perf_data_file__open(file))
@@ -139,9 +141,6 @@ struct perf_session *perf_session__new(struct perf_data_file *file,
139141
tool->ordered_events && !perf_evlist__sample_id_all(session->evlist)) {
140142
dump_printf("WARNING: No sample_id_all support, falling back to unordered processing\n");
141143
tool->ordered_events = false;
142-
} else {
143-
ordered_events__init(&session->ordered_events, &session->machines,
144-
session->evlist, tool, ordered_events__deliver_event);
145144
}
146145

147146
return session;

0 commit comments

Comments
 (0)