Add version string to AOS timing report

This sets us up to more readily indicate what version of an application
crashed when the starter observes an application crash. This also will
help us to identify situations where there are mixed versions of
binaries on sprayers.

Change-Id: I4d265552d6c3cadd43b834f343da50aec46be4ef
Signed-off-by: James Kuszmaul <james.kuszmaul@bluerivertech.com>
diff --git a/aos/events/event_loop.h b/aos/events/event_loop.h
index 3926e26..1ed4337 100644
--- a/aos/events/event_loop.h
+++ b/aos/events/event_loop.h
@@ -808,6 +808,16 @@
   // Returns the boot UUID.
   virtual const UUID &boot_uuid() const = 0;
 
+  // Sets the version string that will be used in any newly constructed
+  // EventLoop objects. This can be overridden for individual EventLoop's by
+  // calling EventLoop::SetVersionString(). The version string is populated into
+  // the timing report message. Makes a copy of the provided string_view.
+  static void SetDefaultVersionString(std::string_view version);
+
+  // Overrides the version string for this event loop. Makes a copy of the
+  // provided string_view.
+  void SetVersionString(std::string_view version);
+
  protected:
   // Sets the name of the event loop.  This is the application name.
   virtual void set_name(const std::string_view name) = 0;
@@ -898,6 +908,13 @@
  private:
   virtual pid_t GetTid() = 0;
 
+  // Default version string to be used in the timing report for any newly
+  // created EventLoop objects.
+  static std::optional<std::string> default_version_string_;
+
+  // Timing report version string for this event loop.
+  std::optional<std::string> version_string_;
+
   FlatbufferDetachedBuffer<timing::Report> timing_report_;
 
   ::std::atomic<bool> is_running_{false};