Logger: Pipe the monotonic_remote_transmit_time through event loop
Populate the field in all the network bridges and pipe it through
all the required spots in the event loop. Update all the tests to match
the update.
As part of this, we realized that our modeling of network delay was
wrong. Wakeups don't always take 50 uS if something else triggers the
wakeup and the message is ready in shared memory. This wasn't being
handled properly.
Change-Id: Idf94c5c6d7c87f4d65868c71b1cceedca7bf3853
Signed-off-by: James Kuszmaul <james.kuszmaul@bluerivertech.com>
diff --git a/aos/ipc_lib/queue_racer.cc b/aos/ipc_lib/queue_racer.cc
index aa73f2b..2797c24 100644
--- a/aos/ipc_lib/queue_racer.cc
+++ b/aos/ipc_lib/queue_racer.cc
@@ -197,7 +197,8 @@
++started_writes_;
auto result =
sender.Send(sizeof(ThreadPlusCount), aos::monotonic_clock::min_time,
- aos::realtime_clock::min_time, 0xffffffff,
+ aos::realtime_clock::min_time,
+ aos::monotonic_clock::min_time, 0xffffffff,
UUID::FromSpan(absl::Span<const uint8_t>(
reinterpret_cast<const uint8_t *>(&tpc),
sizeof(ThreadPlusCount))),
@@ -309,6 +310,7 @@
monotonic_clock::time_point monotonic_sent_time;
realtime_clock::time_point realtime_sent_time;
monotonic_clock::time_point monotonic_remote_time;
+ monotonic_clock::time_point monotonic_remote_transmit_time;
realtime_clock::time_point realtime_remote_time;
UUID source_boot_uuid;
uint32_t remote_queue_index;
@@ -321,14 +323,16 @@
0xffffffffu, LocklessQueueSize(queue_.memory())));
LocklessQueueReader::Result read_result =
set_should_read
- ? reader.Read(wrapped_i, &monotonic_sent_time, &realtime_sent_time,
- &monotonic_remote_time, &realtime_remote_time,
- &remote_queue_index, &source_boot_uuid, &length,
- &(read_data[0]), std::ref(should_read))
+ ? reader.Read(
+ wrapped_i, &monotonic_sent_time, &realtime_sent_time,
+ &monotonic_remote_time, &monotonic_remote_transmit_time,
+ &realtime_remote_time, &remote_queue_index, &source_boot_uuid,
+ &length, &(read_data[0]), std::ref(should_read))
: reader.Read(wrapped_i, &monotonic_sent_time, &realtime_sent_time,
- &monotonic_remote_time, &realtime_remote_time,
- &remote_queue_index, &source_boot_uuid, &length,
- &(read_data[0]), nop);
+ &monotonic_remote_time,
+ &monotonic_remote_transmit_time,
+ &realtime_remote_time, &remote_queue_index,
+ &source_boot_uuid, &length, &(read_data[0]), nop);
// The code in lockless_queue.cc reads everything but data, checks that the
// header hasn't changed, then reads the data. So, if we succeed and both