Add a BootTimestamp class and move some things over
This makes it so we can compare timestamps again across boots. Move
most things over to using it instead so we can more naturally track what
happens in what order.
Note: this is not complete and has no tests. Anywhere where I'm not
comfortable that the code will handle it today should now CHECK that the
count is 0 so we explode. Tests and tolerance of reboots will come in
future patches, starting with TimestampMapper and then with the
time recover code and then LogReader.
Change-Id: I0fdbbe1860de4fe5e48d1a6cd516e7118e5942dc
Signed-off-by: Austin Schuh <austin.schuh@bluerivertech.com>
diff --git a/aos/events/logging/log_reader.h b/aos/events/logging/log_reader.h
index 37163c1..5cfb5df 100644
--- a/aos/events/logging/log_reader.h
+++ b/aos/events/logging/log_reader.h
@@ -258,13 +258,15 @@
void SeedSortedMessages();
// Returns the starting time for this node.
- monotonic_clock::time_point monotonic_start_time() const {
- return timestamp_mapper_ ? timestamp_mapper_->monotonic_start_time()
- : monotonic_clock::min_time;
+ monotonic_clock::time_point monotonic_start_time(size_t boot_count) const {
+ return timestamp_mapper_
+ ? timestamp_mapper_->monotonic_start_time(boot_count)
+ : monotonic_clock::min_time;
}
- realtime_clock::time_point realtime_start_time() const {
- return timestamp_mapper_ ? timestamp_mapper_->realtime_start_time()
- : realtime_clock::min_time;
+ realtime_clock::time_point realtime_start_time(size_t boot_count) const {
+ return timestamp_mapper_
+ ? timestamp_mapper_->realtime_start_time(boot_count)
+ : realtime_clock::min_time;
}
// Sets the node event loop factory for replaying into a
@@ -307,8 +309,10 @@
// Returns the start time of the remote for the provided channel.
monotonic_clock::time_point monotonic_remote_start_time(
+ size_t boot_count,
size_t channel_index) {
- return channel_source_state_[channel_index]->monotonic_start_time();
+ return channel_source_state_[channel_index]->monotonic_start_time(
+ boot_count);
}
distributed_clock::time_point RemoteToDistributedClock(