From: Adrian Hunter Date: Mon, 11 Jul 2022 09:31:46 +0000 (+0300) Subject: perf ordered_events: Add ordered_events__last_flush_time() X-Git-Tag: v6.0-rc1~95^2~141 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f8bcf1e223ad08a4f0d45369a749c58c9bcd5f3c;p=thirdparty%2Fkernel%2Flinux.git perf ordered_events: Add ordered_events__last_flush_time() Allow callers to get the ordered_events last flush timestamp. This is needed in perf inject to obey finished-round ordering when injecting additional events (e.g. from a guest perf.data file) with timestamps. Any additional events that have timestamps before the last flush time must be injected before the corresponding FINISHED_ROUND event. Signed-off-by: Adrian Hunter Acked-by: Ian Rogers Cc: Andi Kleen Cc: Jiri Olsa Cc: Namhyung Kim Cc: kvm@vger.kernel.org Link: https://lore.kernel.org/r/20220711093218.10967-4-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/perf/util/ordered-events.h b/tools/perf/util/ordered-events.h index 0b05c3c0aeaa8..8febbd7c98ca8 100644 --- a/tools/perf/util/ordered-events.h +++ b/tools/perf/util/ordered-events.h @@ -75,4 +75,10 @@ void ordered_events__set_copy_on_queue(struct ordered_events *oe, bool copy) { oe->copy_on_queue = copy; } + +static inline u64 ordered_events__last_flush_time(struct ordered_events *oe) +{ + return oe->last_flush; +} + #endif /* __ORDERED_EVENTS_H */