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
diff --git a/tests/profiling/gatordmock/GatordMockService.hpp b/tests/profiling/gatordmock/GatordMockService.hpp
index c860f16..10bf884 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 @@
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 @@
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 @@
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 @@
}
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 @@
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 @@
std::thread m_ListeningThread;
std::atomic<bool> m_CloseReceivingThread;
};
-} // namespace gatordmock
+} // namespace gatordmock
-} // namespace armnn
-
-
+} // namespace armnn