ArmNN  NotReleased
TimelineCaptureCommandHandler.hpp
Go to the documentation of this file.
1 //
2 // Copyright © 2019 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
6 #pragma once
7 
8 #include "ITimelineDecoder.h"
9 
11 #include <Packet.hpp>
12 #include <ProfilingUtils.hpp>
13 
14 namespace armnn
15 {
16 
17 namespace gatordmock
18 {
19 
21 {
22  // Utils
23  uint32_t uint32_t_size = sizeof(uint32_t);
24  uint32_t uint64_t_size = sizeof(uint64_t);
25  uint32_t threadId_size = sizeof(std::thread::id);
26 
27  using ReadFunction = void (TimelineCaptureCommandHandler::*)(const unsigned char*, uint32_t);
28 
29 public:
30  TimelineCaptureCommandHandler(uint32_t familyId,
31  uint32_t packetId,
32  uint32_t version,
33  Model* model,
34  bool quietOperation = false)
35  : CommandHandlerFunctor(familyId, packetId, version)
36  , m_Model(model)
37  , m_QuietOperation(quietOperation)
38  {}
39 
40  void operator()(const armnn::profiling::Packet& packet) override;
41 
42  void ReadLabel(const unsigned char* data, uint32_t offset);
43  void ReadEntity(const unsigned char* data, uint32_t offset);
44  void ReadEventClass(const unsigned char* data, uint32_t offset);
45  void ReadRelationship(const unsigned char* data, uint32_t offset);
46  void ReadEvent(const unsigned char* data, uint32_t offset);
47 
48  void print();
49 
50 private:
51  void ParseData(const armnn::profiling::Packet& packet);
52 
53  Model* m_Model;
54  bool m_QuietOperation;
55  static const ReadFunction m_ReadFunctions[];
56 
57  void printLabels();
58  void printEntities();
59  void printEventClasses();
60  void printRelationships();
61  void printEvents();
62 };
63 
64 } //namespace gatordmock
65 
66 } //namespace armnn
void ReadLabel(const unsigned char *data, uint32_t offset)
void operator()(const armnn::profiling::Packet &packet) override
void ReadEntity(const unsigned char *data, uint32_t offset)
void ReadRelationship(const unsigned char *data, uint32_t offset)
void ReadEvent(const unsigned char *data, uint32_t offset)
void ReadEventClass(const unsigned char *data, uint32_t offset)
TimelineCaptureCommandHandler(uint32_t familyId, uint32_t packetId, uint32_t version, Model *model, bool quietOperation=false)