IVGCVSW-4666 Call EnableProfiling when state switches to active
* Move the call to EnableProfiling() into ConnectionAcknowledgedHandler
* Fix an issue with MockGatord forcing some command handlers to be quiet
* Add some small unrelated improvements and typo fixes to the
periodic counter command handlers
Signed-off-by: Finn Williams <Finn.Williams@arm.com>
Change-Id: I9e6066b78d1f782cfaf27c11571c0ec5cb5d126f
diff --git a/src/profiling/ConnectionAcknowledgedCommandHandler.cpp b/src/profiling/ConnectionAcknowledgedCommandHandler.cpp
index 0071bfc..995562f 100644
--- a/src/profiling/ConnectionAcknowledgedCommandHandler.cpp
+++ b/src/profiling/ConnectionAcknowledgedCommandHandler.cpp
@@ -41,9 +41,21 @@
// Send the counter directory packet.
m_SendCounterPacket.SendCounterDirectoryPacket(m_CounterDirectory);
m_SendTimelinePacket.SendTimelineMessageDirectoryPackage();
-
TimelineUtilityMethods::SendWellKnownLabelsAndEventClasses(m_SendTimelinePacket);
+ if(m_BackendProfilingContext.has_value())
+ {
+ for (auto backendContext : m_BackendProfilingContext.value())
+ {
+ // Enable profiling on the backend and assert that it returns true
+ if(!backendContext.second->EnableProfiling(true))
+ {
+ throw BackendProfilingException(
+ "Unable to enable profiling on Backend Id: " + backendContext.first.Get());
+ }
+ }
+ }
+
break;
case ProfilingState::Active:
return; // NOP