From 344302581b66677a748a456f370752db75adde21 Mon Sep 17 00:00:00 2001 From: Jim Flynn Date: Fri, 4 Mar 2022 15:03:58 +0000 Subject: IVGCVSW-6816 Inject counter registration into ProfilingService Change-Id: I87ce3a1306eced9fc347cc383d9c7bc8994f0b0c Signed-off-by: Jim Flynn --- src/profiling/ProfilingService.hpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'src/profiling/ProfilingService.hpp') diff --git a/src/profiling/ProfilingService.hpp b/src/profiling/ProfilingService.hpp index 7919c3019a..efad871c8c 100644 --- a/src/profiling/ProfilingService.hpp +++ b/src/profiling/ProfilingService.hpp @@ -50,7 +50,9 @@ public: using BackendProfilingContext = std::unordered_map>; - ProfilingService(armnn::Optional reportStructure = armnn::EmptyOptional()) + ProfilingService(uint16_t maxGlobalCounterId, + IInitialiseProfilingService& initialiser, + armnn::Optional reportStructure = armnn::EmptyOptional()) : m_Options() , m_TimelineReporting(false) , m_CounterDirectory() @@ -118,8 +120,9 @@ public: m_StateMachine, *this) , m_TimelinePacketWriterFactory(m_BufferManager) - , m_MaxGlobalCounterId(INFERENCES_RUN) + , m_MaxGlobalCounterId(maxGlobalCounterId) , m_ServiceActive(false) + , m_Initialiser(initialiser) { // Register the "Connection Acknowledged" command handler m_CommandHandlerRegistry.RegisterFunctor(&m_ConnectionAcknowledgedCommandHandler); @@ -151,7 +154,7 @@ public: void Update(); // Disconnects the profiling service from the external server - void Disconnect(); + void Disconnect() override; // Store a profiling context returned from a backend that support profiling. void AddBackendProfilingContext(const std::string& backendId, @@ -170,6 +173,8 @@ public: // counter global/backend mapping functions const ICounterMappings& GetCounterMappings() const override; IRegisterCounterMapping& GetCounterMappingRegistry() override; + bool IsCategoryRegistered(const std::string& categoryName) const override; + bool IsCounterRegistered(const std::string& counterName) const override; // Getters for the profiling service state bool IsProfilingEnabled() const override; @@ -185,6 +190,8 @@ public: uint32_t SubtractCounterValue(uint16_t counterUid, uint32_t value) override; uint32_t IncrementCounterValue(uint16_t counterUid) override; + void InitializeCounterValue(uint16_t counterUid) override; + std::unique_ptr GetSendTimelinePacket() const override; ISendCounterPacket& GetSendCounterPacket() override @@ -211,7 +218,6 @@ private: // Initialization/reset functions void Initialize(); - void InitializeCounterValue(uint16_t counterUid); void Reset(); void Stop(); @@ -256,6 +262,8 @@ private: std::condition_variable m_ServiceActiveConditionVariable; bool m_ServiceActive; + IInitialiseProfilingService& m_Initialiser; + protected: // Protected methods for testing -- cgit v1.2.1