Allow the session client to specify that event ordering should be stopped when not all events have time stamps. Suggested-by: Ian Munsie Signed-off-by: Thomas Gleixner --- tools/perf/util/session.c | 13 ++++++++++++- tools/perf/util/session.h | 1 + 2 files changed, 13 insertions(+), 1 deletion(-) Index: linux-2.6-tip/tools/perf/util/session.c =================================================================== --- linux-2.6-tip.orig/tools/perf/util/session.c +++ linux-2.6-tip/tools/perf/util/session.c @@ -751,12 +751,23 @@ static int preprocess_sample_record(stru static int process_user_event(struct perf_session *session, event_t *event, struct perf_event_ops *ops, u64 file_offset) { + int ret; + dump_event(session, event, file_offset, NULL); /* These events are processed right away */ switch (event->header.type) { case PERF_RECORD_HEADER_ATTR: - return ops->attr(event, session); + /* This updates session->sample_id_all */ + ret = ops->attr(event, session); + /* Break ordering if sample_id_all is false */ + if (ops->ordering_requires_timestamps && + ops->ordered_samples && !session->sample_id_all) { + session->ordered_samples.next_flush = ULLONG_MAX; + flush_sample_queue(session, ops); + ops->ordered_samples = false; + } + return ret; case PERF_RECORD_HEADER_EVENT_TYPE: return ops->event_type(event, session); case PERF_RECORD_HEADER_TRACING_DATA: Index: linux-2.6-tip/tools/perf/util/session.h =================================================================== --- linux-2.6-tip.orig/tools/perf/util/session.h +++ linux-2.6-tip/tools/perf/util/session.h @@ -78,6 +78,7 @@ struct perf_event_ops { build_id; event_op2 finished_round; bool ordered_samples; + bool ordering_requires_timestamps; }; struct perf_session *perf_session__new(const char *filename, int mode, bool force, bool repipe); -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/