diff options
author | Jim Flynn <jim.flynn@arm.com> | 2022-03-04 15:03:58 +0000 |
---|---|---|
committer | Jim Flynn <jim.flynn@arm.com> | 2022-03-06 19:12:00 +0000 |
commit | 344302581b66677a748a456f370752db75adde21 (patch) | |
tree | 6463b11c70c501e46a2a93d7d57f4f68e4b78cb6 /src/profiling/ProfilingService.hpp | |
parent | 9c315305aaa31a3d1610738cd40f558381f8c687 (diff) | |
download | armnn-344302581b66677a748a456f370752db75adde21.tar.gz |
IVGCVSW-6816 Inject counter registration into ProfilingService
Change-Id: I87ce3a1306eced9fc347cc383d9c7bc8994f0b0c
Signed-off-by: Jim Flynn <jim.flynn@arm.com>
Diffstat (limited to 'src/profiling/ProfilingService.hpp')
-rw-r--r-- | src/profiling/ProfilingService.hpp | 16 |
1 files changed, 12 insertions, 4 deletions
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<std::string, std::shared_ptr<IBackendProfilingContext>>; - ProfilingService(armnn::Optional<IReportStructure&> reportStructure = armnn::EmptyOptional()) + ProfilingService(uint16_t maxGlobalCounterId, + IInitialiseProfilingService& initialiser, + armnn::Optional<IReportStructure&> 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<ISendTimelinePacket> 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 |