Add a field 'min_timestamp' in struct ordered_samples to record the minimial timestamp of the samples in ordered_samples->samples.
Cc: David Ahern <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Arnaldo Carvalho de Melo <[email protected]> Cc: Arjan van de Ven <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Yanmin Zhang <[email protected]> Cc: Wu Fengguang <[email protected]> Cc: Mike Galbraith <[email protected]> Cc: Andrew Morton <[email protected]> Signed-off-by: Chenggang Qin <[email protected]> --- tools/perf/util/session.c | 3 +++ tools/perf/util/session.h | 1 + 2 files changed, 4 insertions(+), 0 deletions(-) diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c index 193bb6a..4e9dd66 100644 --- a/tools/perf/util/session.c +++ b/tools/perf/util/session.c @@ -708,6 +708,9 @@ int perf_session_queue_event(struct perf_session *s, union perf_event *event, new->file_offset = file_offset; new->event = event; + if (list_empty(&os->samples) || os->min_timestamp > timestamp) + os->min_timestamp = timestamp; + __queue_event(new, s); return 0; diff --git a/tools/perf/util/session.h b/tools/perf/util/session.h index c9a6c27..7d411b9 100644 --- a/tools/perf/util/session.h +++ b/tools/perf/util/session.h @@ -18,6 +18,7 @@ struct ordered_samples { u64 last_flush; u64 next_flush; u64 max_timestamp; + u64 min_timestamp; struct list_head samples; struct list_head sample_cache; struct list_head to_free; -- 1.7.8.rc2.5.g815b -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

