8 #include <common/include/ProfilingException.hpp> 9 #include <server/include/timelineDecoder/ITimelineDecoder.hpp> 20 using LabelMap = std::map<uint64_t, arm::pipe::ITimelineDecoder::Label>;
21 using Attribute = std::pair<std::string, std::string>;
28 m_Guid(guid), m_HeadEntity(head), m_TailEntity(tail)
33 ss <<
"connection [" << guid <<
"] head cannot be null";
34 throw arm::pipe::ProfilingException(ss.str());
39 ss <<
"connection [" << guid <<
"] tail cannot be null";
40 throw arm::pipe::ProfilingException(ss.str());
55 EventClassObj(uint64_t guid,
const std::string& name) : m_Guid(guid), m_Name(name) {}
57 const std::string&
GetName()
const {
return m_Name;}
65 EventObj(uint64_t guid, uint64_t timestamp, uint64_t threadId) :
66 m_Guid(guid), m_TimeStamp(timestamp), m_ThreadId(threadId) {}
73 if (m_EventClass ==
nullptr)
79 return m_EventClass->GetName();
91 Entity(uint64_t guid) : m_Guid(guid) {}
97 m_Children.push_back(child);
103 m_Attributes.emplace(type, attr);
107 m_Connections.push_back(connection);
111 if (execution !=
nullptr)
113 m_Executions.push_back(execution);
118 if (event !=
nullptr)
120 m_Events.push_back(event);
124 const std::vector<Entity*>&
GetChildren()
const {
return m_Children;}
127 const std::vector<EventObj*>&
GetEvents()
const {
return m_Events;}
131 std::vector<Entity*> m_Children;
132 std::vector<Connection> m_Connections;
133 std::vector<Entity*> m_Executions;
134 std::vector<EventObj*> m_Events;
139 ModelRelationship(
const arm::pipe::ITimelineDecoder::Relationship& relationship) : m_Relationship(relationship) {}
145 using Events = std::map<uint64_t, EventObj>;
149 void AddLabel(
const arm::pipe::ITimelineDecoder::Label& label);
150 std::string* FindLabel(uint64_t guid);
151 void AddEntity(uint64_t guid);
152 Entity* FindEntity(uint64_t
id);
153 void AddRelationship(
const arm::pipe::ITimelineDecoder::Relationship& relationship);
157 const std::vector<arm::pipe::ProfilingException>&
GetErrors()
const {
return m_Errors;}
158 bool IsInferenceGuid(uint64_t guid)
const;
159 void AddEventClass(
const arm::pipe::ITimelineDecoder::EventClass& eventClass);
162 void AddEvent(
const arm::pipe::ITimelineDecoder::Event& event);
168 std::vector<arm::pipe::ProfilingException> m_Errors;
169 std::vector<uint64_t> m_InferenceGuids;
173 void HandleLabelLink(
const arm::pipe::ITimelineDecoder::Relationship& relationship);
174 void HandleConnection(
const arm::pipe::ITimelineDecoder::Relationship& relationship);
175 void HandleChild(
const arm::pipe::ITimelineDecoder::Relationship& relationship);
176 void HandleExecutionOf(
const arm::pipe::ITimelineDecoder::Relationship& relationship);
177 void HandleExecutionLink(
const arm::pipe::ITimelineDecoder::Relationship& relationship);
const std::string & GetName() const
std::map< uint64_t, Entity > Entities
void AddEvent(EventObj *event)
std::string GetConnectionDescription(const Connection &connection)
std::map< uint64_t, ModelRelationship > Relationships
const Attributes & GetAttributes() const
const std::vector< Entity * > & GetExecutions() const
Connection(uint64_t guid, Entity *head, Entity *tail)
EventObj(uint64_t guid, uint64_t timestamp, uint64_t threadId)
std::map< uint64_t, EventClassObj > EventClasses
uint64_t GetTimeStamp() const
std::map< std::string, Attribute > Attributes
const std::vector< arm::pipe::ProfilingException > & GetErrors() const
Copyright (c) 2021 ARM Limited and Contributors.
arm::pipe::ITimelineDecoder::Relationship m_Relationship
const Entities & GetEntities() const
std::pair< std::string, std::string > Attribute
void AddChild(Entity *child)
const LabelMap & GetLabelMap() const
uint64_t GetThreadId() const
void AddConnection(const Connection &connection)
void AddAttribute(const std::string &type, const std::string &value)
const Entity * GetTail() const
const std::vector< EventObj * > & GetEvents() const
const std::vector< Connection > & GetConnections() const
std::vector< Entity * > m_RelatedEntities
std::map< uint64_t, arm::pipe::ITimelineDecoder::Label > LabelMap
EventClassObj(uint64_t guid, const std::string &name)
std::string GetExecutionDescription(Entity *execution)
const EventClasses & GetEventClasses() const
std::vector< std::string > GetModelDescription(const TimelineModel &model)
const std::vector< Entity * > & GetChildren() const
void SetEventClass(EventClassObj *evtClass)
std::string GetEntityDescription(const Entity &entity)
ModelRelationship(const arm::pipe::ITimelineDecoder::Relationship &relationship)
std::map< uint64_t, EventObj > Events
std::string GetEventDescription(EventObj *event)
void AddExecution(Entity *execution)
const Entity * GetHead() const
std::string GetEventClass()
std::string GetChildDescription(Entity *entity)