diff options
author | Colm Donelan <Colm.Donelan@arm.com> | 2019-10-16 12:24:20 +0100 |
---|---|---|
committer | Colm Donelan <colm.donelan@arm.com> | 2019-10-17 15:59:55 +0000 |
commit | b682d840bb0b4cc34f4febb69c2385feec880ae1 (patch) | |
tree | 155457d5c382deec0b45fd85a0609a4c3322613e /tests/profiling/gatordmock/GatordMockMain.cpp | |
parent | 5ae78299f117a61c48a67c5381341501571a0b03 (diff) | |
download | armnn-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/GatordMockMain.cpp')
-rw-r--r-- | tests/profiling/gatordmock/GatordMockMain.cpp | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/tests/profiling/gatordmock/GatordMockMain.cpp b/tests/profiling/gatordmock/GatordMockMain.cpp index 500b016669..002d6c7c5a 100644 --- a/tests/profiling/gatordmock/GatordMockMain.cpp +++ b/tests/profiling/gatordmock/GatordMockMain.cpp @@ -3,15 +3,18 @@ // SPDX-License-Identifier: MIT // +#include "../../../src/profiling/PacketVersionResolver.hpp" +#include "../../../src/profiling/PeriodicCounterSelectionCommandHandler.hpp" #include "CommandFileParser.hpp" #include "CommandLineProcessor.hpp" #include "GatordMockService.hpp" -#include "MockUtils.hpp" #include "PeriodicCounterCaptureCommandHandler.hpp" +#include "PeriodicCounterSelectionResponseHandler.hpp" +#include <iostream> #include <string> -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { // Process command line arguments armnn::gatordmock::CommandLineProcessor cmdLine; @@ -20,21 +23,19 @@ int main(int argc, char *argv[]) return EXIT_FAILURE; } - // Initialise functors and register into the CommandHandlerRegistry - uint32_t version = 1; - - // Create headers - uint32_t counterCaptureCommandHeader = armnn::gatordmock::ConstructHeader(1,0,0); - + armnn::profiling::PacketVersionResolver packetVersionResolver; // Create the Command Handler Registry armnn::profiling::CommandHandlerRegistry registry; - // Update with derived functors - armnn::gatordmock::PeriodicCounterCaptureCommandHandler counterCaptureCommandHandler(counterCaptureCommandHeader, - version, - cmdLine.IsEchoEnabled()); + // This functor will receive back the selection response packet. + armnn::gatordmock::PeriodicCounterSelectionResponseHandler periodicCounterSelectionResponseHandler( + 4, packetVersionResolver.ResolvePacketVersion(4).GetEncodedValue()); + // This functor will receive the counter data. + armnn::gatordmock::PeriodicCounterCaptureCommandHandler counterCaptureCommandHandler( + 0, packetVersionResolver.ResolvePacketVersion(0).GetEncodedValue()); // Register different derived functors + registry.RegisterFunctor(&periodicCounterSelectionResponseHandler); registry.RegisterFunctor(&counterCaptureCommandHandler); armnn::gatordmock::GatordMockService mockService(registry, cmdLine.IsEchoEnabled()); @@ -43,12 +44,14 @@ int main(int argc, char *argv[]) { return EXIT_FAILURE; } + std::cout << "Bound to UDS namespace: \\0" << cmdLine.GetUdsNamespace() << std::endl; // Wait for a single connection. if (-1 == mockService.BlockForOneClient()) { return EXIT_FAILURE; } + std::cout << "Client connection established." << std::endl; // Send receive the strweam metadata and send connection ack. if (!mockService.WaitForStreamMetaData()) |