From 6940dd720ebb6b3d1df8ca203ab696daefe58189 Mon Sep 17 00:00:00 2001 From: Jim Flynn Date: Fri, 20 Mar 2020 12:25:56 +0000 Subject: renamed Documentation folder 20.02 and added .nojekyll file Signed-off-by: Jim Flynn --- 20.02/_gatord_mock_main_8cpp_source.xhtml | 136 ++++++++++++++++++++++++++++++ 1 file changed, 136 insertions(+) create mode 100644 20.02/_gatord_mock_main_8cpp_source.xhtml (limited to '20.02/_gatord_mock_main_8cpp_source.xhtml') diff --git a/20.02/_gatord_mock_main_8cpp_source.xhtml b/20.02/_gatord_mock_main_8cpp_source.xhtml new file mode 100644 index 0000000000..9fce71a5b2 --- /dev/null +++ b/20.02/_gatord_mock_main_8cpp_source.xhtml @@ -0,0 +1,136 @@ + + + + + + + + + + + + + +ArmNN: tests/profiling/gatordmock/GatordMockMain.cpp Source File + + + + + + + + + + + + + + + + +
+
+ + + + ArmNN + + + +
+
+  20.02 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
GatordMockMain.cpp
+
+
+Go to the documentation of this file.
1 //
2 // Copyright © 2019 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
6 #include "../../../src/profiling/PacketVersionResolver.hpp"
7 #include "../../../src/profiling/PeriodicCounterSelectionCommandHandler.hpp"
8 #include "CommandFileParser.hpp"
11 #include "GatordMockService.hpp"
14 
15 #include <iostream>
16 #include <string>
17 
18 int main(int argc, char* argv[])
19 {
20  // Process command line arguments
22  if (!cmdLine.ProcessCommandLine(argc, argv))
23  {
24  return EXIT_FAILURE;
25  }
26 
27  armnn::profiling::PacketVersionResolver packetVersionResolver;
28  // Create the Command Handler Registry
30 
31  // This functor will receive back the selection response packet.
32  armnn::gatordmock::PeriodicCounterSelectionResponseHandler periodicCounterSelectionResponseHandler(
33  0, 4, packetVersionResolver.ResolvePacketVersion(0, 4).GetEncodedValue());
34  // This functor will receive the counter data.
36  3, 0, packetVersionResolver.ResolvePacketVersion(3, 0).GetEncodedValue());
37 
38  armnn::profiling::DirectoryCaptureCommandHandler directoryCaptureCommandHandler(
39  0, 2, packetVersionResolver.ResolvePacketVersion(0, 2).GetEncodedValue(), false);
40 
41  // Register different derived functors
42  registry.RegisterFunctor(&periodicCounterSelectionResponseHandler);
43  registry.RegisterFunctor(&counterCaptureCommandHandler);
44  registry.RegisterFunctor(&directoryCaptureCommandHandler);
45 
46  armnn::gatordmock::GatordMockService mockService(registry, cmdLine.IsEchoEnabled());
47 
48  if (!mockService.OpenListeningSocket(cmdLine.GetUdsNamespace()))
49  {
50  return EXIT_FAILURE;
51  }
52  std::cout << "Bound to UDS namespace: \\0" << cmdLine.GetUdsNamespace() << std::endl;
53 
54  // Wait for a single connection.
55  if (-1 == mockService.BlockForOneClient())
56  {
57  return EXIT_FAILURE;
58  }
59  std::cout << "Client connection established." << std::endl;
60 
61  // Send receive the strweam metadata and send connection ack.
62  if (!mockService.WaitForStreamMetaData())
63  {
64  return EXIT_FAILURE;
65  }
66  mockService.SendConnectionAck();
67 
68  // Prepare to receive data.
69  mockService.LaunchReceivingThread();
70 
71  // Process the SET and WAIT command from the file.
72  armnn::gatordmock::CommandFileParser commandLineParser;
73  commandLineParser.ParseFile(cmdLine.GetCommandFile(), mockService);
74 
75  // Once we've finished processing the file wait for the receiving thread to close.
76  mockService.WaitForReceivingThread();
77 
78  return EXIT_SUCCESS;
79 }
bool ProcessCommandLine(int argc, char *argv[])
+ + + +
int main(int argc, char *argv[])
+
Version ResolvePacketVersion(uint32_t familyId, uint32_t packetId) const
+ + +
void ParseFile(std::string CommandFile, GatordMockService &mockService)
+ + + + + +
void RegisterFunctor(CommandHandlerFunctor *functor, uint32_t familyId, uint32_t packetId, uint32_t version)
+ +
Use Boost program options to process the command line.
+ +
A class that implements a Mock Gatord server.
+
This class parses a command file for the GatordMockService.
+ + + +
+
+ + + + -- cgit v1.2.1