aboutsummaryrefslogtreecommitdiff
path: root/tests/profiling/gatordmock/GatordMockService.hpp
diff options
context:
space:
mode:
authorColm Donelan <Colm.Donelan@arm.com>2019-10-16 12:24:20 +0100
committerColm Donelan <colm.donelan@arm.com>2019-10-17 15:59:55 +0000
commitb682d840bb0b4cc34f4febb69c2385feec880ae1 (patch)
tree155457d5c382deec0b45fd85a0609a4c3322613e /tests/profiling/gatordmock/GatordMockService.hpp
parent5ae78299f117a61c48a67c5381341501571a0b03 (diff)
downloadarmnn-b682d840bb0b4cc34f4febb69c2385feec880ae1.tar.gz
IVGCVSW-3721 Add support for startup sequence (Mock Gatord service).
* Updated ExecuteNetwork to propagate a configured Runtime down to RunTest. * Fixed the creation of PeriodicCounterCaptureCommandHandler to match other handlers. * Moved around some printouts to make the MockGatorD output more useful. * Added details to the exception handling for problems in the GatordMockService receive thread. * Mockutils::ConstructHeader is only used in GatordMockTests. Moved it in there and deleted MockUtils.hpp * Refactored SendPeriodicCounterSelectionList to use ProfilingUtils. * Added PeriodicCounterSelectionResponseHandler to received packet echoed back. Signed-off-by: Colm Donelan <Colm.Donelan@arm.com> Change-Id: I4accdbf6cf5dd3f7dcc12b210b8360b4a5e4e277
Diffstat (limited to 'tests/profiling/gatordmock/GatordMockService.hpp')
-rw-r--r--tests/profiling/gatordmock/GatordMockService.hpp28
1 files changed, 13 insertions, 15 deletions
diff --git a/tests/profiling/gatordmock/GatordMockService.hpp b/tests/profiling/gatordmock/GatordMockService.hpp
index c860f16815..10bf88406e 100644
--- a/tests/profiling/gatordmock/GatordMockService.hpp
+++ b/tests/profiling/gatordmock/GatordMockService.hpp
@@ -8,9 +8,9 @@
#include <CommandHandlerRegistry.hpp>
#include <Packet.hpp>
+#include <atomic>
#include <string>
#include <thread>
-#include <atomic>
namespace armnn
{
@@ -20,12 +20,15 @@ namespace gatordmock
enum class TargetEndianness
{
- BeWire, LeWire
+ BeWire,
+ LeWire
};
enum class PacketDirection
{
- Sending, Received
+ Sending,
+ ReceivedHeader,
+ ReceivedData
};
/// A class that implements a Mock Gatord server. It will listen on a specified Unix domain socket (UDS)
@@ -33,8 +36,6 @@ enum class PacketDirection
class GatordMockService
{
public:
-
-
/// @param registry reference to a command handler registry.
/// @param echoPackets if true the raw packets will be printed to stdout.
GatordMockService(armnn::profiling::CommandHandlerRegistry& registry, bool echoPackets)
@@ -83,7 +84,7 @@ public:
void WaitForReceivingThread();
/// Send the counter list to ArmNN.
- void SendPeriodicCounterSelectionList(uint period, std::vector<uint16_t> counters);
+ void SendPeriodicCounterSelectionList(uint32_t period, std::vector<uint16_t> counters);
/// Execute the WAIT command from the comamnd file.
void WaitCommand(uint timeout);
@@ -104,7 +105,6 @@ public:
}
private:
-
void ReceiveLoop(GatordMockService& mockService);
/// Block on the client connection until a complete packet has been received. This is a placeholder function to
@@ -129,10 +129,10 @@ private:
static const uint32_t PIPE_MAGIC = 0x45495434;
std::atomic<uint32_t> m_PacketsReceivedCount;
- TargetEndianness m_Endianness;
- uint32_t m_StreamMetaDataVersion;
- uint32_t m_StreamMetaDataMaxDataLen;
- uint32_t m_StreamMetaDataPid;
+ TargetEndianness m_Endianness;
+ uint32_t m_StreamMetaDataVersion;
+ uint32_t m_StreamMetaDataMaxDataLen;
+ uint32_t m_StreamMetaDataPid;
armnn::profiling::CommandHandlerRegistry& m_HandlerRegistry;
@@ -142,8 +142,6 @@ private:
std::thread m_ListeningThread;
std::atomic<bool> m_CloseReceivingThread;
};
-} // namespace gatordmock
-
-} // namespace armnn
-
+} // namespace gatordmock
+} // namespace armnn