diff options
author | Matteo Martincigh <matteo.martincigh@arm.com> | 2019-10-07 10:19:35 +0100 |
---|---|---|
committer | Matteo Martincigh <matteo.martincigh@arm.com> | 2019-10-07 16:04:07 +0100 |
commit | e61ffd00a37f02338129e92d65be2f01600014c0 (patch) | |
tree | 415a475edeae4e7487b512ce78315228819bab87 /src/profiling/SendCounterPacket.hpp | |
parent | f21f606ac60fca82a320de6a706e69d84d3c895c (diff) | |
download | armnn-e61ffd00a37f02338129e92d65be2f01600014c0.tar.gz |
IVGCVSW-3937 Make dynamic use the of the profiling connection
in the SendCounterPacket class
* Passing the profiling connection as an argument to the
pertinent methods of the SendCounterPacket class, as the
connection is created dynamically by the ProfilingService
* Updated the unit tests accordingly
Signed-off-by: Matteo Martincigh <matteo.martincigh@arm.com>
Change-Id: Ibe72bdbad814a201c4f1505cff4badbb9b03b13e
Diffstat (limited to 'src/profiling/SendCounterPacket.hpp')
-rw-r--r-- | src/profiling/SendCounterPacket.hpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/profiling/SendCounterPacket.hpp b/src/profiling/SendCounterPacket.hpp index 748371b9fa..ed76937cc3 100644 --- a/src/profiling/SendCounterPacket.hpp +++ b/src/profiling/SendCounterPacket.hpp @@ -33,12 +33,11 @@ public: using IndexValuePairsVector = std::vector<std::pair<uint16_t, uint32_t>>; - SendCounterPacket(IProfilingConnection& profilingConnection, IBufferManager& buffer, int timeout = 1) - : m_ProfilingConnection(profilingConnection) - , m_BufferManager(buffer) + SendCounterPacket(IBufferManager& buffer, int timeout = 1000) + : m_BufferManager(buffer) + , m_Timeout(timeout) , m_IsRunning(false) , m_KeepRunning(false) - , m_Timeout(timeout) {} ~SendCounterPacket() { Stop(); } @@ -56,12 +55,12 @@ public: static const unsigned int PIPE_MAGIC = 0x45495434; static const unsigned int MAX_METADATA_PACKET_LENGTH = 4096; - void Start(); + void Start(IProfilingConnection& profilingConnection); void Stop(); bool IsRunning() { return m_IsRunning.load(); } private: - void Send(); + void Send(IProfilingConnection& profilingConnection); template <typename ExceptionType> void CancelOperationAndThrow(const std::string& errorMessage) @@ -87,16 +86,15 @@ private: throw ExceptionType(errorMessage); } - void FlushBuffer(); + void FlushBuffer(IProfilingConnection& profilingConnection); - IProfilingConnection& m_ProfilingConnection; IBufferManager& m_BufferManager; + int m_Timeout; std::mutex m_WaitMutex; std::condition_variable m_WaitCondition; std::thread m_SendThread; std::atomic<bool> m_IsRunning; std::atomic<bool> m_KeepRunning; - int m_Timeout; protected: // Helper methods, protected for testing |