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/events/shm_event_loop.cc b/aos/events/shm_event_loop.cc
index 7f06ee0..9d010b7 100644
--- a/aos/events/shm_event_loop.cc
+++ b/aos/events/shm_event_loop.cc
@@ -237,6 +237,7 @@
     ipc_lib::LocklessQueueReader::Result read_result = reader_.Read(
         queue_index.index(), &context_.monotonic_event_time,
         &context_.realtime_event_time, &context_.monotonic_remote_time,
+        &context_.monotonic_remote_transmit_time,
         &context_.realtime_remote_time, &context_.remote_queue_index,
         &context_.source_boot_uuid, &context_.size, copy_buffer, std::move(fn));
 
@@ -457,6 +458,7 @@
   Error DoSend(size_t length,
                aos::monotonic_clock::time_point monotonic_remote_time,
                aos::realtime_clock::time_point realtime_remote_time,
+               aos::monotonic_clock::time_point monotonic_remote_transmit_time,
                uint32_t remote_queue_index,
                const UUID &source_boot_uuid) override {
     shm_event_loop()->CheckCurrentThread();
@@ -464,9 +466,9 @@
         << ": Sent too big a message on "
         << configuration::CleanedChannelToString(channel());
     const auto result = lockless_queue_sender_.Send(
-        length, monotonic_remote_time, realtime_remote_time, remote_queue_index,
-        source_boot_uuid, &monotonic_sent_time_, &realtime_sent_time_,
-        &sent_queue_index_);
+        length, monotonic_remote_time, realtime_remote_time,
+        monotonic_remote_transmit_time, remote_queue_index, source_boot_uuid,
+        &monotonic_sent_time_, &realtime_sent_time_, &sent_queue_index_);
     CHECK_NE(result, ipc_lib::LocklessQueueSender::Result::INVALID_REDZONE)
         << ": Somebody wrote outside the buffer of their message on channel "
         << configuration::CleanedChannelToString(channel());
@@ -480,6 +482,7 @@
   Error DoSend(const void *msg, size_t length,
                aos::monotonic_clock::time_point monotonic_remote_time,
                aos::realtime_clock::time_point realtime_remote_time,
+               aos::monotonic_clock::time_point monotonic_remote_transmit_time,
                uint32_t remote_queue_index,
                const UUID &source_boot_uuid) override {
     shm_event_loop()->CheckCurrentThread();
@@ -488,8 +491,9 @@
         << configuration::CleanedChannelToString(channel());
     const auto result = lockless_queue_sender_.Send(
         reinterpret_cast<const char *>(msg), length, monotonic_remote_time,
-        realtime_remote_time, remote_queue_index, source_boot_uuid,
-        &monotonic_sent_time_, &realtime_sent_time_, &sent_queue_index_);
+        realtime_remote_time, monotonic_remote_transmit_time,
+        remote_queue_index, source_boot_uuid, &monotonic_sent_time_,
+        &realtime_sent_time_, &sent_queue_index_);
 
     CHECK_NE(result, ipc_lib::LocklessQueueSender::Result::INVALID_REDZONE)
         << ": Somebody wrote outside the buffer of their message on "