IVGCVSW-4722 Add missing m_TimelineEnabled bool to ConnectionAcknowledgedCommandHandler

 * Added timeline bool to ConnectionAcknowledgedCommandHandler
 * Added option to enable timeline profiling in ExecuteNetwork
 * Added CommandHandler stub to allow gatordMock to ignore packets

Signed-off-by: Finn Williams <Finn.Williams@arm.com>
Change-Id: I314f9411e0079cba8f103d3b8a89f2bf38bb21ab
diff --git a/src/profiling/ConnectionAcknowledgedCommandHandler.cpp b/src/profiling/ConnectionAcknowledgedCommandHandler.cpp
index 995562f..7690573 100644
--- a/src/profiling/ConnectionAcknowledgedCommandHandler.cpp
+++ b/src/profiling/ConnectionAcknowledgedCommandHandler.cpp
@@ -40,8 +40,12 @@
         m_StateMachine.TransitionToState(ProfilingState::Active);
         // Send the counter directory packet.
         m_SendCounterPacket.SendCounterDirectoryPacket(m_CounterDirectory);
-        m_SendTimelinePacket.SendTimelineMessageDirectoryPackage();
-        TimelineUtilityMethods::SendWellKnownLabelsAndEventClasses(m_SendTimelinePacket);
+
+        if (m_TimelineEnabled)
+        {
+            m_SendTimelinePacket.SendTimelineMessageDirectoryPackage();
+            TimelineUtilityMethods::SendWellKnownLabelsAndEventClasses(m_SendTimelinePacket);
+        }
 
         if(m_BackendProfilingContext.has_value())
         {
diff --git a/src/profiling/ConnectionAcknowledgedCommandHandler.hpp b/src/profiling/ConnectionAcknowledgedCommandHandler.hpp
index e2bdff8..053d3c3 100644
--- a/src/profiling/ConnectionAcknowledgedCommandHandler.hpp
+++ b/src/profiling/ConnectionAcknowledgedCommandHandler.hpp
@@ -44,12 +44,18 @@
 
     void operator()(const Packet& packet) override;
 
+    void setTimelineEnabled(bool timelineEnabled)
+    {
+        m_TimelineEnabled = timelineEnabled;
+    }
+
 private:
     const ICounterDirectory& m_CounterDirectory;
     ISendCounterPacket&      m_SendCounterPacket;
     ISendTimelinePacket&     m_SendTimelinePacket;
     ProfilingStateMachine&   m_StateMachine;
     Optional<BackendProfilingContexts> m_BackendProfilingContext;
+    bool m_TimelineEnabled = false;
 };
 
 } // namespace profiling
diff --git a/src/profiling/ProfilingService.cpp b/src/profiling/ProfilingService.cpp
index 4d7241e..d87ed0b 100644
--- a/src/profiling/ProfilingService.cpp
+++ b/src/profiling/ProfilingService.cpp
@@ -35,6 +35,7 @@
     // Update the profiling options
     m_Options = options;
     m_TimelineReporting = options.m_TimelineEnabled;
+    m_ConnectionAcknowledgedCommandHandler.setTimelineEnabled(options.m_TimelineEnabled);
 
     // Check if the profiling service needs to be reset
     if (resetProfilingService)
diff --git a/src/timelineDecoder/TimelineDecoder.cpp b/src/timelineDecoder/TimelineDecoder.cpp
index f7f4663..9aa84d2 100644
--- a/src/timelineDecoder/TimelineDecoder.cpp
+++ b/src/timelineDecoder/TimelineDecoder.cpp
@@ -151,6 +151,13 @@
 
 void TimelineDecoder::print()
 {
+    if (m_Model.m_Labels.empty() && m_Model.m_Entities.empty() && m_Model.m_EventClasses.empty() &&
+        m_Model.m_Events.empty() && m_Model.m_Relationships.empty())
+    {
+        std::cout << "No timeline packets received" << std::endl;
+        return;
+    }
+
     printLabels();
     printEntities();
     printEventClasses();