From 032bc74ca4bc6589a33f23db31accddc5b20baaa Mon Sep 17 00:00:00 2001 From: Finn Williams Date: Wed, 12 Feb 2020 11:02:34 +0000 Subject: IVGCVSW-4338 Implement the Activation of Counters in backends Signed-off-by: Finn Williams Change-Id: I4a2465f06e046f78242ff0a246c651638b205498 --- src/profiling/ProfilingService.hpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/profiling/ProfilingService.hpp') diff --git a/src/profiling/ProfilingService.hpp b/src/profiling/ProfilingService.hpp index 54c6540f7e..2584c76020 100644 --- a/src/profiling/ProfilingService.hpp +++ b/src/profiling/ProfilingService.hpp @@ -36,6 +36,7 @@ static const uint16_t NETWORK_UNLOADS = 1; static const uint16_t REGISTERED_BACKENDS = 2; static const uint16_t UNREGISTERED_BACKENDS = 3; static const uint16_t INFERENCES_RUN = 4; +static const uint16_t MAX_ARMNN_COUNTER = INFERENCES_RUN; class ProfilingService : public IReadWriteCounterValues, public IProfilingGuidGenerator { @@ -83,7 +84,9 @@ public: bool IsProfilingEnabled(); CaptureData GetCaptureData(); - void SetCaptureData(uint32_t capturePeriod, const std::vector& counterIds); + void SetCaptureData(uint32_t capturePeriod, + const std::vector& counterIds, + const std::set& activeBackends); // Setters for the profiling service state void SetCounterValue(uint16_t counterUid, uint32_t value) override; @@ -143,7 +146,7 @@ private: ProfilingGuidGenerator m_GuidGenerator; TimelinePacketWriterFactory m_TimelinePacketWriterFactory; std::unordered_map> m_BackendProfilingContexts; + std::shared_ptr> m_BackendProfilingContexts; uint16_t m_MaxGlobalCounterId; protected: @@ -166,7 +169,7 @@ protected: , m_SendCounterPacket(m_BufferManager) , m_SendThread(m_StateMachine, m_BufferManager, m_SendCounterPacket) , m_SendTimelinePacket(m_BufferManager) - , m_PeriodicCounterCapture(m_Holder, m_SendCounterPacket, *this) + , m_PeriodicCounterCapture(m_Holder, m_SendCounterPacket, *this, m_CounterIdMap, m_BackendProfilingContexts) , m_ConnectionAcknowledgedCommandHandler(0, 1, m_PacketVersionResolver.ResolvePacketVersion(0, 1).GetEncodedValue(), @@ -184,7 +187,10 @@ protected: , m_PeriodicCounterSelectionCommandHandler(0, 4, m_PacketVersionResolver.ResolvePacketVersion(0, 4).GetEncodedValue(), + m_BackendProfilingContexts, + m_CounterIdMap, m_Holder, + MAX_ARMNN_COUNTER, m_PeriodicCounterCapture, *this, m_SendCounterPacket, -- cgit v1.2.1