Add remote_boot_uuid to Context
This lets us track which boot a message came from and finally fix the
logger relying on ServerStatistics having all the required information
needed to build up the logfile header.
Change-Id: I17fc4c5718d5d69c7a1e154afdd83b1ccb388a8f
diff --git a/aos/events/simulated_event_loop.cc b/aos/events/simulated_event_loop.cc
index b38829e..9d431b7 100644
--- a/aos/events/simulated_event_loop.cc
+++ b/aos/events/simulated_event_loop.cc
@@ -294,12 +294,14 @@
bool DoSend(size_t length,
aos::monotonic_clock::time_point monotonic_remote_time,
aos::realtime_clock::time_point realtime_remote_time,
- uint32_t remote_queue_index) override;
+ uint32_t remote_queue_index,
+ const UUID &remote_boot_uuid) override;
bool DoSend(const void *msg, size_t size,
aos::monotonic_clock::time_point monotonic_remote_time,
aos::realtime_clock::time_point realtime_remote_time,
- uint32_t remote_queue_index) override;
+ uint32_t remote_queue_index,
+ const UUID &remote_boot_uuid) override;
int buffer_index() override {
// First, ensure message_ is allocated.
@@ -834,10 +836,11 @@
simulated_channel_->CountSenderDestroyed();
}
-bool SimulatedSender::DoSend(
- size_t length, aos::monotonic_clock::time_point monotonic_remote_time,
- aos::realtime_clock::time_point realtime_remote_time,
- uint32_t remote_queue_index) {
+bool SimulatedSender::DoSend(size_t length,
+ monotonic_clock::time_point monotonic_remote_time,
+ realtime_clock::time_point realtime_remote_time,
+ uint32_t remote_queue_index,
+ const UUID &remote_boot_uuid) {
// The allocations in here are due to infrastructure and don't count in the
// no mallocs in RT code.
ScopedNotRealtime nrt;
@@ -847,6 +850,7 @@
message_->context.remote_queue_index = remote_queue_index;
message_->context.realtime_event_time = event_loop_->realtime_now();
message_->context.realtime_remote_time = realtime_remote_time;
+ message_->context.remote_boot_uuid = remote_boot_uuid;
CHECK_LE(length, message_->context.size);
message_->context.size = length;
@@ -862,11 +866,11 @@
return true;
}
-bool SimulatedSender::DoSend(
- const void *msg, size_t size,
- aos::monotonic_clock::time_point monotonic_remote_time,
- aos::realtime_clock::time_point realtime_remote_time,
- uint32_t remote_queue_index) {
+bool SimulatedSender::DoSend(const void *msg, size_t size,
+ monotonic_clock::time_point monotonic_remote_time,
+ realtime_clock::time_point realtime_remote_time,
+ uint32_t remote_queue_index,
+ const UUID &remote_boot_uuid) {
CHECK_LE(size, this->size())
<< ": Attempting to send too big a message on "
<< configuration::CleanedChannelToString(simulated_channel_->channel());
@@ -883,7 +887,7 @@
msg, size);
return DoSend(size, monotonic_remote_time, realtime_remote_time,
- remote_queue_index);
+ remote_queue_index, remote_boot_uuid);
}
SimulatedTimerHandler::SimulatedTimerHandler(