From 3201eea0565ce2bb0418d1936fec71bdeb14c084 Mon Sep 17 00:00:00 2001 From: Keith Davis Date: Thu, 24 Oct 2019 17:30:41 +0100 Subject: IVGCVSW-3444 File Only Profiling Connection * Add FileOnlyProfilingConnection Decorator * Fix bug where Conn Ack not automatically sent back * Modify GatordMock to use the Counter Directory class. * Promote DirectoryCaptureCommandHandler from GatordMock into ArmNN. * Remove MockUtils as it's contents were moved or deleted. * Rewrite GatordMockTests to use Counter Directory class. * Flush streams in ProfilingConnectionDumpToFileDecorator::Close. Signed-off-by: Keith Davis Signed-off-by: Colm Donelan Change-Id: I77b2aedece24150dd31691b577f3b5d81b2e226f --- tests/profiling/gatordmock/GatordMockService.cpp | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'tests/profiling/gatordmock/GatordMockService.cpp') diff --git a/tests/profiling/gatordmock/GatordMockService.cpp b/tests/profiling/gatordmock/GatordMockService.cpp index 5e9f8203d1..46f6547b41 100644 --- a/tests/profiling/gatordmock/GatordMockService.cpp +++ b/tests/profiling/gatordmock/GatordMockService.cpp @@ -6,8 +6,8 @@ #include "GatordMockService.hpp" #include -#include "../../src/profiling/PacketVersionResolver.hpp" -#include "../../src/profiling/ProfilingUtils.hpp" +#include +#include #include #include @@ -231,12 +231,12 @@ void GatordMockService::ReceiveLoop(GatordMockService& mockService) { // In this case we ignore timeouts and and keep trying to receive. } - catch (const armnn::InvalidArgumentException &e) + catch (const armnn::InvalidArgumentException& e) { // We couldn't find a functor to handle the packet? std::cerr << "Packet received that could not be processed: " << e.what() << std::endl; } - catch (const armnn::RuntimeException &e) + catch (const armnn::RuntimeException& e) { // A runtime exception occurred which means we must exit the loop. std::cerr << "Receive thread closing: " << e.what() << std::endl; @@ -331,15 +331,14 @@ armnn::profiling::Packet GatordMockService::ReceivePacket() std::cout << "Processing packet ID= " << packetRx.GetPacketId() << " Length=" << packetRx.GetLength() << std::endl; } - // Pass packet into the handler registry - m_PacketsReceivedCount.operator++(std::memory_order::memory_order_release); - m_HandlerRegistry - .GetFunctor(packetRx.GetPacketFamily(), - packetRx.GetPacketId(), - packetVersionResolver.ResolvePacketVersion(packetRx.GetPacketFamily(), - packetRx.GetPacketId()).GetEncodedValue()) - ->operator()(packetRx); + profiling::Version version = + packetVersionResolver.ResolvePacketVersion(packetRx.GetPacketFamily(), packetRx.GetPacketId()); + + profiling::CommandHandlerFunctor* commandHandlerFunctor = + m_HandlerRegistry.GetFunctor(packetRx.GetPacketFamily(), packetRx.GetPacketId(), version.GetEncodedValue()); + BOOST_ASSERT(commandHandlerFunctor); + commandHandlerFunctor->operator()(packetRx); return packetRx; } -- cgit v1.2.1