Handle messages from before the start time
These messages violate the "max_out_of_order" time by definition. We
log one message per channel, round robin. So, queue them all up before
continuing.
Change-Id: Ida38292630a6dd1035ff59e931c3053d127aafd9
diff --git a/aos/events/logging/logfile_utils.h b/aos/events/logging/logfile_utils.h
index 4a19209..d24e0af 100644
--- a/aos/events/logging/logfile_utils.h
+++ b/aos/events/logging/logfile_utils.h
@@ -394,6 +394,10 @@
// Cache of the time we are sorted until.
aos::monotonic_clock::time_point sorted_until_ = monotonic_clock::min_time;
+ // Timestamp of the last message returned. Used to make sure nothing goes
+ // backwards.
+ monotonic_clock::time_point last_message_time_ = monotonic_clock::min_time;
+
// Set used for efficient sorting of messages. We can benchmark and evaluate
// other data structures if this proves to be the bottleneck.
absl::btree_set<Message> messages_;
@@ -443,6 +447,10 @@
// Cached node.
int node_;
+ // Timestamp of the last message returned. Used to make sure nothing goes
+ // backwards.
+ monotonic_clock::time_point last_message_time_ = monotonic_clock::min_time;
+
realtime_clock::time_point realtime_start_time_ = realtime_clock::max_time;
monotonic_clock::time_point monotonic_start_time_ = monotonic_clock::max_time;
};