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/shm_event_loop.cc b/aos/events/shm_event_loop.cc
index 61a4149..63e1cb9 100644
--- a/aos/events/shm_event_loop.cc
+++ b/aos/events/shm_event_loop.cc
@@ -63,7 +63,7 @@
}
std::string ShmPath(std::string_view shm_base, const Channel *channel) {
CHECK(channel->has_type());
- return ShmFolder(shm_base, channel) + channel->type()->str() + ".v3";
+ return ShmFolder(shm_base, channel) + channel->type()->str() + ".v4";
}
void PageFaultDataWrite(char *data, size_t size) {
@@ -372,7 +372,7 @@
queue_index.index(), &context_.monotonic_event_time,
&context_.realtime_event_time, &context_.monotonic_remote_time,
&context_.realtime_remote_time, &context_.remote_queue_index,
- &context_.size, copy_buffer);
+ &context_.remote_boot_uuid, &context_.size, copy_buffer);
if (read_result == ipc_lib::LocklessQueueReader::Result::GOOD) {
if (pin_data()) {
@@ -535,13 +535,15 @@
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 {
CHECK_LE(length, static_cast<size_t>(channel()->max_size()))
<< ": Sent too big a message on "
<< configuration::CleanedChannelToString(channel());
- CHECK(lockless_queue_sender_.Send(
- length, monotonic_remote_time, realtime_remote_time, remote_queue_index,
- &monotonic_sent_time_, &realtime_sent_time_, &sent_queue_index_))
+ CHECK(lockless_queue_sender_.Send(length, monotonic_remote_time,
+ realtime_remote_time, remote_queue_index,
+ remote_boot_uuid, &monotonic_sent_time_,
+ &realtime_sent_time_, &sent_queue_index_))
<< ": Somebody wrote outside the buffer of their message on channel "
<< configuration::CleanedChannelToString(channel());
@@ -552,14 +554,15 @@
bool DoSend(const void *msg, 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 {
CHECK_LE(length, static_cast<size_t>(channel()->max_size()))
<< ": Sent too big a message on "
<< configuration::CleanedChannelToString(channel());
CHECK(lockless_queue_sender_.Send(
reinterpret_cast<const char *>(msg), length, monotonic_remote_time,
- realtime_remote_time, remote_queue_index, &monotonic_sent_time_,
- &realtime_sent_time_, &sent_queue_index_))
+ realtime_remote_time, remote_queue_index, remote_boot_uuid,
+ &monotonic_sent_time_, &realtime_sent_time_, &sent_queue_index_))
<< ": Somebody wrote outside the buffer of their message on channel "
<< configuration::CleanedChannelToString(channel());
wake_upper_.Wakeup(event_loop()->priority());