diff options
author | Matteo Martincigh <matteo.martincigh@arm.com> | 2019-10-07 13:05:13 +0100 |
---|---|---|
committer | Matteo Martincigh <matteo.martincigh@arm.com> | 2019-10-08 10:43:50 +0100 |
commit | 5d737fb3b06c17ff6b65fb307343ca1c0c680401 (patch) | |
tree | 91c5548fd4e84ff086e57020a017982124b06c50 /src/profiling/test/ProfilingTests.cpp | |
parent | c2728f95086c54aa842e4c1dae8f3b5c290a72fa (diff) | |
download | armnn-5d737fb3b06c17ff6b65fb307343ca1c0c680401.tar.gz |
IVGCVSW-3937 Update the Send thread to send out the Metadata packet
* The Send thread now automatically sends out Stream Metadata packets when
the Profiling Service is in WaitingForAck state
* Added a reference to the profiling state in the SendCounterPacket class
* Moving the RuntimeException thrown in the Send thread to the main thread
for rethrowing
* The Stop method now rethrows the exception occurred in the send thread
* The Stop method does not rethrow when destructing the object
* Added unit tests
Signed-off-by: Matteo Martincigh <matteo.martincigh@arm.com>
Change-Id: Ice7080bff63199eac84fc4fa1d37fb1a6fcdff89
Diffstat (limited to 'src/profiling/test/ProfilingTests.cpp')
-rw-r--r-- | src/profiling/test/ProfilingTests.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/profiling/test/ProfilingTests.cpp b/src/profiling/test/ProfilingTests.cpp index 91568d111d..24ab779412 100644 --- a/src/profiling/test/ProfilingTests.cpp +++ b/src/profiling/test/ProfilingTests.cpp @@ -1767,6 +1767,8 @@ BOOST_AUTO_TEST_CASE(CounterSelectionCommandHandlerParseData) { using boost::numeric_cast; + ProfilingStateMachine profilingStateMachine; + class TestCaptureThread : public IPeriodicCounterCapture { void Start() override {} @@ -1779,7 +1781,7 @@ BOOST_AUTO_TEST_CASE(CounterSelectionCommandHandlerParseData) Holder holder; TestCaptureThread captureThread; MockBufferManager mockBuffer(512); - SendCounterPacket sendCounterPacket(mockBuffer); + SendCounterPacket sendCounterPacket(profilingStateMachine, mockBuffer); uint32_t sizeOfUint32 = numeric_cast<uint32_t>(sizeof(uint32_t)); uint32_t sizeOfUint16 = numeric_cast<uint32_t>(sizeof(uint16_t)); @@ -2135,12 +2137,14 @@ BOOST_AUTO_TEST_CASE(CheckPeriodicCounterCaptureThread) std::unordered_map<uint16_t, uint32_t> m_Data; }; + ProfilingStateMachine profilingStateMachine; + Holder data; std::vector<uint16_t> captureIds1 = { 0, 1 }; std::vector<uint16_t> captureIds2; MockBufferManager mockBuffer(512); - SendCounterPacket sendCounterPacket(mockBuffer); + SendCounterPacket sendCounterPacket(profilingStateMachine, mockBuffer); std::vector<uint16_t> counterIds; CaptureReader captureReader; @@ -2201,6 +2205,8 @@ BOOST_AUTO_TEST_CASE(RequestCounterDirectoryCommandHandlerTest0) { using boost::numeric_cast; + ProfilingStateMachine profilingStateMachine; + const uint32_t packetId = 0x30000; const uint32_t version = 1; @@ -2209,7 +2215,7 @@ BOOST_AUTO_TEST_CASE(RequestCounterDirectoryCommandHandlerTest0) Packet packetA(packetId, 0, packetData); MockBufferManager mockBuffer(1024); - SendCounterPacket sendCounterPacket(mockBuffer); + SendCounterPacket sendCounterPacket(profilingStateMachine, mockBuffer); CounterDirectory counterDirectory; @@ -2234,6 +2240,8 @@ BOOST_AUTO_TEST_CASE(RequestCounterDirectoryCommandHandlerTest1) { using boost::numeric_cast; + ProfilingStateMachine profilingStateMachine; + const uint32_t packetId = 0x30000; const uint32_t version = 1; @@ -2242,7 +2250,7 @@ BOOST_AUTO_TEST_CASE(RequestCounterDirectoryCommandHandlerTest1) Packet packetA(packetId, 0, packetData); MockBufferManager mockBuffer(1024); - SendCounterPacket sendCounterPacket(mockBuffer); + SendCounterPacket sendCounterPacket(profilingStateMachine, mockBuffer); CounterDirectory counterDirectory; const Device* device = counterDirectory.RegisterDevice("deviceA", 1); |