ArmNN
 20.02
TimelineUtilityMethods Class Reference

#include <TimelineUtilityMethods.hpp>

Public Member Functions

 TimelineUtilityMethods (std::unique_ptr< ISendTimelinePacket > &sendTimelinePacket)
 
 TimelineUtilityMethods (TimelineUtilityMethods &&other)
 
 TimelineUtilityMethods (const TimelineUtilityMethods &other)=delete
 
TimelineUtilityMethodsoperator= (const TimelineUtilityMethods &other)=delete
 
TimelineUtilityMethodsoperator= (TimelineUtilityMethods &&other)=default
 
 ~TimelineUtilityMethods ()=default
 
void SendWellKnownLabelsAndEventClasses ()
 
ProfilingDynamicGuid CreateNamedTypedEntity (const std::string &name, const std::string &type)
 
void CreateNamedTypedEntity (ProfilingGuid entityGuid, const std::string &name, const std::string &type)
 
void CreateNamedTypedEntity (ProfilingGuid entityGuid, const std::string &name, ProfilingStaticGuid typeGuid)
 
void MarkEntityWithLabel (ProfilingGuid entityGuid, const std::string &labelName, ProfilingStaticGuid labelLinkGuid)
 
ProfilingStaticGuid DeclareLabel (const std::string &labelName)
 
void NameEntity (ProfilingGuid entityGuid, const std::string &name)
 
void TypeEntity (ProfilingGuid entityGuid, const std::string &type)
 
ProfilingDynamicGuid CreateNamedTypedChildEntity (ProfilingGuid parentEntityGuid, const std::string &entityName, const std::string &entityType)
 
void CreateNamedTypedChildEntity (ProfilingGuid entityGuid, ProfilingGuid parentEntityGuid, const std::string &entityName, const std::string &entityType)
 
void CreateNamedTypedChildEntity (ProfilingGuid entityGuid, ProfilingGuid parentEntityGuid, const std::string &entityName, ProfilingStaticGuid typeGuid)
 
ProfilingDynamicGuid CreateRelationship (ProfilingRelationshipType relationshipType, ProfilingGuid headGuid, ProfilingGuid tailGuid)
 
ProfilingDynamicGuid CreateConnectionRelationship (ProfilingRelationshipType relationshipType, ProfilingGuid headGuid, ProfilingGuid tailGuid)
 
void CreateTypedEntity (ProfilingGuid entityGuid, ProfilingStaticGuid typeGuid)
 
void MarkEntityWithType (ProfilingGuid entityGuid, ProfilingStaticGuid typeNameGuid)
 
ProfilingDynamicGuid RecordEvent (ProfilingGuid entityGuid, ProfilingStaticGuid eventClassGuid)
 
ProfilingDynamicGuid RecordWorkloadInferenceAndStartOfLifeEvent (ProfilingGuid workloadGuid, ProfilingGuid inferenceGuid)
 
void RecordEndOfLifeEvent (ProfilingGuid entityGuid)
 
void Commit ()
 

Static Public Member Functions

static std::unique_ptr< TimelineUtilityMethodsGetTimelineUtils ()
 

Detailed Description

Definition at line 17 of file TimelineUtilityMethods.hpp.

Constructor & Destructor Documentation

◆ TimelineUtilityMethods() [1/3]

TimelineUtilityMethods ( std::unique_ptr< ISendTimelinePacket > &  sendTimelinePacket)
inline

Definition at line 25 of file TimelineUtilityMethods.hpp.

Referenced by TimelineUtilityMethods::TimelineUtilityMethods().

26  : m_SendTimelinePacket(std::move(sendTimelinePacket)) {}

◆ TimelineUtilityMethods() [2/3]

◆ TimelineUtilityMethods() [3/3]

◆ ~TimelineUtilityMethods()

Member Function Documentation

◆ Commit()

void Commit ( )
inline

Definition at line 88 of file TimelineUtilityMethods.hpp.

88 { m_SendTimelinePacket->Commit(); }

◆ CreateConnectionRelationship()

ProfilingDynamicGuid CreateConnectionRelationship ( ProfilingRelationshipType  relationshipType,
ProfilingGuid  headGuid,
ProfilingGuid  tailGuid 
)

Definition at line 336 of file TimelineUtilityMethods.cpp.

References LabelsAndEventClasses::CONNECTION_GUID, ProfilingService::Instance(), TimelineUtilityMethods::MarkEntityWithType(), and ProfilingService::NextGuid().

Referenced by TimelineUtilityMethods::TimelineUtilityMethods().

339 {
340  // Generate a GUID for the relationship
341  ProfilingDynamicGuid relationshipGuid = ProfilingService::Instance().NextGuid();
342 
343  // Send the new retention link to the external profiling service, this call throws in case of error
344  m_SendTimelinePacket->SendTimelineRelationshipBinaryPacket(relationshipType,
345  relationshipGuid,
346  headGuid,
347  tailGuid);
348 
350  return relationshipGuid;
351 }
static ProfilingService & Instance()
static ARMNN_DLLEXPORT ProfilingStaticGuid CONNECTION_GUID
ProfilingDynamicGuid NextGuid() override
Return the next random Guid in the sequence.
void MarkEntityWithType(ProfilingGuid entityGuid, ProfilingStaticGuid typeNameGuid)

◆ CreateNamedTypedChildEntity() [1/3]

ProfilingDynamicGuid CreateNamedTypedChildEntity ( ProfilingGuid  parentEntityGuid,
const std::string &  entityName,
const std::string &  entityType 
)

Definition at line 231 of file TimelineUtilityMethods.cpp.

References TimelineUtilityMethods::CreateNamedTypedEntity(), ProfilingService::Instance(), ProfilingService::NextGuid(), and armnn::profiling::RetentionLink.

Referenced by TimelineUtilityMethods::TimelineUtilityMethods().

234 {
235  // Check that the entity name is valid
236  if (entityName.empty())
237  {
238  // The entity name is invalid
239  throw InvalidArgumentException("Invalid entity name, the entity name cannot be empty");
240  }
241 
242  // Check that the entity type is valid
243  if (entityType.empty())
244  {
245  // The entity type is invalid
246  throw InvalidArgumentException("Invalid entity type, the entity type cannot be empty");
247  }
248 
249  // Create a named type entity from the given name and type, this call throws in case of error
250  ProfilingDynamicGuid childEntityGuid = CreateNamedTypedEntity(entityName, entityType);
251 
252  // Generate a GUID for the retention link relationship
253  ProfilingDynamicGuid retentionLinkGuid = ProfilingService::Instance().NextGuid();
254 
255  // Send the new retention link to the external profiling service, this call throws in case of error
256  m_SendTimelinePacket->SendTimelineRelationshipBinaryPacket(ProfilingRelationshipType::RetentionLink,
257  retentionLinkGuid,
258  parentEntityGuid,
259  childEntityGuid);
260 
261  return childEntityGuid;
262 }
static ProfilingService & Instance()
ProfilingDynamicGuid NextGuid() override
Return the next random Guid in the sequence.
ProfilingDynamicGuid CreateNamedTypedEntity(const std::string &name, const std::string &type)

◆ CreateNamedTypedChildEntity() [2/3]

void CreateNamedTypedChildEntity ( ProfilingGuid  entityGuid,
ProfilingGuid  parentEntityGuid,
const std::string &  entityName,
const std::string &  entityType 
)

Definition at line 264 of file TimelineUtilityMethods.cpp.

References TimelineUtilityMethods::CreateNamedTypedEntity(), ProfilingService::Instance(), ProfilingService::NextGuid(), and armnn::profiling::RetentionLink.

268 {
269  // Check that the entity name is valid
270  if (entityName.empty())
271  {
272  // The entity name is invalid
273  throw InvalidArgumentException("Invalid entity name, the entity name cannot be empty");
274  }
275 
276  // Check that the entity type is valid
277  if (entityType.empty())
278  {
279  // The entity type is invalid
280  throw InvalidArgumentException("Invalid entity type, the entity type cannot be empty");
281  }
282 
283  // Create a named type entity from the given guid, name and type, this call throws in case of error
284  CreateNamedTypedEntity(childEntityGuid, entityName, entityType);
285 
286  // Generate a GUID for the retention link relationship
287  ProfilingDynamicGuid retentionLinkGuid = ProfilingService::Instance().NextGuid();
288 
289  // Send the new retention link to the external profiling service, this call throws in case of error
290  m_SendTimelinePacket->SendTimelineRelationshipBinaryPacket(ProfilingRelationshipType::RetentionLink,
291  retentionLinkGuid,
292  parentEntityGuid,
293  childEntityGuid);
294 }
static ProfilingService & Instance()
ProfilingDynamicGuid NextGuid() override
Return the next random Guid in the sequence.
ProfilingDynamicGuid CreateNamedTypedEntity(const std::string &name, const std::string &type)

◆ CreateNamedTypedChildEntity() [3/3]

void CreateNamedTypedChildEntity ( ProfilingGuid  entityGuid,
ProfilingGuid  parentEntityGuid,
const std::string &  entityName,
ProfilingStaticGuid  typeGuid 
)

Definition at line 296 of file TimelineUtilityMethods.cpp.

References TimelineUtilityMethods::CreateNamedTypedEntity(), ProfilingService::Instance(), ProfilingService::NextGuid(), and armnn::profiling::RetentionLink.

300 {
301  // Check that the entity name is valid
302  if (entityName.empty())
303  {
304  // The entity name is invalid
305  throw InvalidArgumentException("Invalid entity name, the entity name cannot be empty");
306  }
307 
308  // Create a named type entity from the given guid, name and type, this call throws in case of error
309  CreateNamedTypedEntity(childEntityGuid, entityName, typeGuid);
310 
311  // Generate a GUID for the retention link relationship
312  ProfilingDynamicGuid retentionLinkGuid = ProfilingService::Instance().NextGuid();
313 
314  // Send the new retention link to the external profiling service, this call throws in case of error
315  m_SendTimelinePacket->SendTimelineRelationshipBinaryPacket(ProfilingRelationshipType::RetentionLink,
316  retentionLinkGuid,
317  parentEntityGuid,
318  childEntityGuid);
319 }
static ProfilingService & Instance()
ProfilingDynamicGuid NextGuid() override
Return the next random Guid in the sequence.
ProfilingDynamicGuid CreateNamedTypedEntity(const std::string &name, const std::string &type)

◆ CreateNamedTypedEntity() [1/3]

ProfilingDynamicGuid CreateNamedTypedEntity ( const std::string &  name,
const std::string &  type 
)

Definition at line 80 of file TimelineUtilityMethods.cpp.

References ProfilingService::Instance(), and ProfilingService::NextGuid().

Referenced by TimelineUtilityMethods::CreateNamedTypedChildEntity(), and TimelineUtilityMethods::TimelineUtilityMethods().

81 {
82  // Check that the entity name is valid
83  if (name.empty())
84  {
85  throw InvalidArgumentException("Invalid entity name, the entity name cannot be empty");
86  }
87 
88  // Check that the entity type is valid
89  if (type.empty())
90  {
91  throw InvalidArgumentException("Invalid entity type, the entity type cannot be empty");
92  }
93 
94  // Generate dynamic GUID of the entity
95  ProfilingDynamicGuid entityGuid = ProfilingService::Instance().NextGuid();
96 
97  CreateNamedTypedEntity(entityGuid, name, type);
98 
99  return entityGuid;
100 }
static ProfilingService & Instance()
ProfilingDynamicGuid NextGuid() override
Return the next random Guid in the sequence.
ProfilingDynamicGuid CreateNamedTypedEntity(const std::string &name, const std::string &type)

◆ CreateNamedTypedEntity() [2/3]

void CreateNamedTypedEntity ( ProfilingGuid  entityGuid,
const std::string &  name,
const std::string &  type 
)

Definition at line 102 of file TimelineUtilityMethods.cpp.

References TimelineUtilityMethods::NameEntity(), and TimelineUtilityMethods::TypeEntity().

105 {
106  // Check that the entity name is valid
107  if (name.empty())
108  {
109  throw InvalidArgumentException("Invalid entity name, the entity name cannot be empty");
110  }
111 
112  // Check that the entity type is valid
113  if (type.empty())
114  {
115  throw InvalidArgumentException("Invalid entity type, the entity type cannot be empty");
116  }
117 
118  // Send Entity Binary Packet of the entity to the external profiling service
119  m_SendTimelinePacket->SendTimelineEntityBinaryPacket(entityGuid);
120 
121  // Create name entity and send the relationship of the entity with the given name
122  NameEntity(entityGuid, name);
123 
124  // Create type entity and send the relationship of the entity with the given type
125  TypeEntity(entityGuid, type);
126 }
void NameEntity(ProfilingGuid entityGuid, const std::string &name)
void TypeEntity(ProfilingGuid entityGuid, const std::string &type)

◆ CreateNamedTypedEntity() [3/3]

void CreateNamedTypedEntity ( ProfilingGuid  entityGuid,
const std::string &  name,
ProfilingStaticGuid  typeGuid 
)

Definition at line 128 of file TimelineUtilityMethods.cpp.

References TimelineUtilityMethods::MarkEntityWithType(), and TimelineUtilityMethods::NameEntity().

131 {
132  // Check that the entity name is valid
133  if (name.empty())
134  {
135  throw InvalidArgumentException("Invalid entity name, the entity name cannot be empty");
136  }
137 
138  // Send Entity Binary Packet of the entity to the external profiling service
139  m_SendTimelinePacket->SendTimelineEntityBinaryPacket(entityGuid);
140 
141  // Create name entity and send the relationship of the entity with the given name
142  NameEntity(entityGuid, name);
143 
144  // Create type entity and send the relationship of the entity with the given type
145  MarkEntityWithType(entityGuid, typeGuid);
146 }
void NameEntity(ProfilingGuid entityGuid, const std::string &name)
void MarkEntityWithType(ProfilingGuid entityGuid, ProfilingStaticGuid typeNameGuid)

◆ CreateRelationship()

ProfilingDynamicGuid CreateRelationship ( ProfilingRelationshipType  relationshipType,
ProfilingGuid  headGuid,
ProfilingGuid  tailGuid 
)

Definition at line 321 of file TimelineUtilityMethods.cpp.

References ProfilingService::Instance(), and ProfilingService::NextGuid().

Referenced by TimelineUtilityMethods::RecordWorkloadInferenceAndStartOfLifeEvent(), and TimelineUtilityMethods::TimelineUtilityMethods().

324 {
325  // Generate a GUID for the relationship
326  ProfilingDynamicGuid relationshipGuid = ProfilingService::Instance().NextGuid();
327 
328  // Send the new retention link to the external profiling service, this call throws in case of error
329  m_SendTimelinePacket->SendTimelineRelationshipBinaryPacket(relationshipType,
330  relationshipGuid,
331  headGuid,
332  tailGuid);
333  return relationshipGuid;
334 }
static ProfilingService & Instance()
ProfilingDynamicGuid NextGuid() override
Return the next random Guid in the sequence.

◆ CreateTypedEntity()

void CreateTypedEntity ( ProfilingGuid  entityGuid,
ProfilingStaticGuid  typeGuid 
)

Definition at line 353 of file TimelineUtilityMethods.cpp.

References TimelineUtilityMethods::MarkEntityWithType().

Referenced by TimelineUtilityMethods::RecordWorkloadInferenceAndStartOfLifeEvent(), and TimelineUtilityMethods::TimelineUtilityMethods().

354 {
355  // Send Entity Binary Packet of the entity to the external profiling service
356  m_SendTimelinePacket->SendTimelineEntityBinaryPacket(entityGuid);
357 
358  // Create type entity and send the relationship of the entity with the given type
359  MarkEntityWithType(entityGuid, entityTypeGuid);
360 }
void MarkEntityWithType(ProfilingGuid entityGuid, ProfilingStaticGuid typeNameGuid)

◆ DeclareLabel()

ProfilingStaticGuid DeclareLabel ( const std::string &  labelName)

Definition at line 148 of file TimelineUtilityMethods.cpp.

References ProfilingService::GenerateStaticId(), and ProfilingService::Instance().

Referenced by TimelineUtilityMethods::MarkEntityWithLabel(), and TimelineUtilityMethods::TimelineUtilityMethods().

149 {
150  // Check that the label name is valid
151  if (labelName.empty())
152  {
153  // The label name is invalid
154  throw InvalidArgumentException("Invalid label name, the label name cannot be empty");
155  }
156 
157  // Generate a static GUID for the given label name
158  ProfilingStaticGuid labelGuid = ProfilingService::Instance().GenerateStaticId(labelName);
159 
160  // Send the new label to the external profiling service, this call throws in case of error
161  m_SendTimelinePacket->SendTimelineLabelBinaryPacket(labelGuid, labelName);
162 
163  return labelGuid;
164 }
static ProfilingService & Instance()
ProfilingStaticGuid GenerateStaticId(const std::string &str) override
Create a ProfilingStaticGuid based on a hash of the string.

◆ GetTimelineUtils()

std::unique_ptr< TimelineUtilityMethods > GetTimelineUtils ( )
static

Definition at line 16 of file TimelineUtilityMethods.cpp.

References ProfilingService::GetSendTimelinePacket(), and ProfilingService::Instance().

Referenced by LoadedNetwork::EnqueueWorkload(), and LoadedNetwork::MakeLoadedNetwork().

17 {
18  if (ProfilingService::Instance().IsEnabled())
19  {
20  std::unique_ptr<ISendTimelinePacket> sendTimelinepacket = ProfilingService::Instance().GetSendTimelinePacket();
21  return std::make_unique<TimelineUtilityMethods>(sendTimelinepacket);
22  }
23  else
24  {
25  std::unique_ptr<TimelineUtilityMethods> empty;
26  return empty;
27  }
28 }
static ProfilingService & Instance()
std::unique_ptr< ISendTimelinePacket > GetSendTimelinePacket() const override

◆ MarkEntityWithLabel()

void MarkEntityWithLabel ( ProfilingGuid  entityGuid,
const std::string &  labelName,
ProfilingStaticGuid  labelLinkGuid 
)

Definition at line 166 of file TimelineUtilityMethods.cpp.

References TimelineUtilityMethods::DeclareLabel(), ProfilingService::Instance(), armnn::profiling::LabelLink, and ProfilingService::NextGuid().

Referenced by TimelineUtilityMethods::NameEntity(), TimelineUtilityMethods::TimelineUtilityMethods(), and TimelineUtilityMethods::TypeEntity().

169 {
170  // Check that the label name is valid
171  if (labelName.empty())
172  {
173  // The label name is invalid
174  throw InvalidArgumentException("Invalid entity name, the entity name cannot be empty");
175  }
176 
177  // Declare a label with the label's name, this call throws in case of error
178  ProfilingStaticGuid labelGuid = DeclareLabel(labelName);
179 
180  // Generate a GUID for the label relationship
181  ProfilingDynamicGuid relationshipGuid = ProfilingService::Instance().NextGuid();
182 
183  // Send the new label link to the external profiling service, this call throws in case of error
184  m_SendTimelinePacket->SendTimelineRelationshipBinaryPacket(ProfilingRelationshipType::LabelLink,
185  relationshipGuid,
186  entityGuid,
187  labelGuid);
188 
189  // Generate a GUID for the label relationship
190  ProfilingDynamicGuid relationshipLabelGuid = ProfilingService::Instance().NextGuid();
191 
192  // Send the new label link to the external profiling service, this call throws in case of error
193  m_SendTimelinePacket->SendTimelineRelationshipBinaryPacket(ProfilingRelationshipType::LabelLink,
194  relationshipLabelGuid,
195  relationshipGuid,
196  labelTypeGuid);
197 }
static ProfilingService & Instance()
ProfilingDynamicGuid NextGuid() override
Return the next random Guid in the sequence.
ProfilingStaticGuid DeclareLabel(const std::string &labelName)

◆ MarkEntityWithType()

void MarkEntityWithType ( ProfilingGuid  entityGuid,
ProfilingStaticGuid  typeNameGuid 
)

Definition at line 199 of file TimelineUtilityMethods.cpp.

References ProfilingService::Instance(), armnn::profiling::LabelLink, ProfilingService::NextGuid(), and LabelsAndEventClasses::TYPE_GUID.

Referenced by TimelineUtilityMethods::CreateConnectionRelationship(), TimelineUtilityMethods::CreateNamedTypedEntity(), TimelineUtilityMethods::CreateTypedEntity(), and TimelineUtilityMethods::TimelineUtilityMethods().

201 {
202  // Generate a GUID for the label relationship
203  ProfilingDynamicGuid relationshipGuid = ProfilingService::Instance().NextGuid();
204 
205  // Send the new label link to the external profiling service, this call throws in case of error
206  m_SendTimelinePacket->SendTimelineRelationshipBinaryPacket(ProfilingRelationshipType::LabelLink,
207  relationshipGuid,
208  entityGuid,
209  typeNameGuid);
210 
211  // Generate a GUID for the label relationship
212  ProfilingDynamicGuid relationshipLabelGuid = ProfilingService::Instance().NextGuid();
213 
214  // Send the new label link to the external profiling service, this call throws in case of error
215  m_SendTimelinePacket->SendTimelineRelationshipBinaryPacket(ProfilingRelationshipType::LabelLink,
216  relationshipLabelGuid,
217  relationshipGuid,
219 }
static ProfilingService & Instance()
ProfilingDynamicGuid NextGuid() override
Return the next random Guid in the sequence.
static ARMNN_DLLEXPORT ProfilingStaticGuid TYPE_GUID

◆ NameEntity()

void NameEntity ( ProfilingGuid  entityGuid,
const std::string &  name 
)

Definition at line 221 of file TimelineUtilityMethods.cpp.

References TimelineUtilityMethods::MarkEntityWithLabel(), and LabelsAndEventClasses::NAME_GUID.

Referenced by TimelineUtilityMethods::CreateNamedTypedEntity(), and TimelineUtilityMethods::TimelineUtilityMethods().

222 {
224 }
static ARMNN_DLLEXPORT ProfilingStaticGuid NAME_GUID
void MarkEntityWithLabel(ProfilingGuid entityGuid, const std::string &labelName, ProfilingStaticGuid labelLinkGuid)

◆ operator=() [1/2]

◆ operator=() [2/2]

TimelineUtilityMethods& operator= ( TimelineUtilityMethods &&  other)
default

◆ RecordEndOfLifeEvent()

void RecordEndOfLifeEvent ( ProfilingGuid  entityGuid)

Definition at line 408 of file TimelineUtilityMethods.cpp.

References LabelsAndEventClasses::ARMNN_PROFILING_EOL_EVENT_CLASS, and TimelineUtilityMethods::RecordEvent().

Referenced by TimelineUtilityMethods::TimelineUtilityMethods().

409 {
411 }
static ARMNN_DLLEXPORT ProfilingStaticGuid ARMNN_PROFILING_EOL_EVENT_CLASS
ProfilingDynamicGuid RecordEvent(ProfilingGuid entityGuid, ProfilingStaticGuid eventClassGuid)

◆ RecordEvent()

ProfilingDynamicGuid RecordEvent ( ProfilingGuid  entityGuid,
ProfilingStaticGuid  eventClassGuid 
)

Definition at line 362 of file TimelineUtilityMethods.cpp.

References armnn::profiling::DataLink, armnn::profiling::ExecutionLink, armnn::profiling::GetTimestamp(), ProfilingService::Instance(), and ProfilingService::NextGuid().

Referenced by TimelineUtilityMethods::RecordEndOfLifeEvent(), TimelineUtilityMethods::RecordWorkloadInferenceAndStartOfLifeEvent(), and TimelineUtilityMethods::TimelineUtilityMethods().

363 {
364  // Take a timestamp
365  uint64_t timestamp = GetTimestamp();
366 
367  // Get the thread id
368  std::thread::id threadId = std::this_thread::get_id();
369 
370  // Generate a GUID for the event
371  ProfilingDynamicGuid eventGuid = ProfilingService::Instance().NextGuid();
372 
373  // Send the new timeline event to the external profiling service, this call throws in case of error
374  m_SendTimelinePacket->SendTimelineEventBinaryPacket(timestamp, threadId, eventGuid);
375 
376  // Generate a GUID for the execution link
377  ProfilingDynamicGuid executionLinkId = ProfilingService::Instance().NextGuid();
378 
379  // Send the new execution link to the external profiling service, this call throws in case of error
380  m_SendTimelinePacket->SendTimelineRelationshipBinaryPacket(ProfilingRelationshipType::ExecutionLink,
381  executionLinkId,
382  entityGuid,
383  eventGuid);
384 
385  // Generate a GUID for the data relationship link
386  ProfilingDynamicGuid eventClassLinkId = ProfilingService::Instance().NextGuid();
387 
388  // Send the new data relationship link to the external profiling service, this call throws in case of error
389  m_SendTimelinePacket->SendTimelineRelationshipBinaryPacket(ProfilingRelationshipType::DataLink,
390  eventClassLinkId,
391  eventGuid,
392  eventClassGuid);
393 
394  return eventGuid;
395 }
static ProfilingService & Instance()
Head execution start depends on Tail execution completion.
ProfilingDynamicGuid NextGuid() override
Return the next random Guid in the sequence.

◆ RecordWorkloadInferenceAndStartOfLifeEvent()

ProfilingDynamicGuid RecordWorkloadInferenceAndStartOfLifeEvent ( ProfilingGuid  workloadGuid,
ProfilingGuid  inferenceGuid 
)

Definition at line 397 of file TimelineUtilityMethods.cpp.

References LabelsAndEventClasses::ARMNN_PROFILING_SOL_EVENT_CLASS, TimelineUtilityMethods::CreateRelationship(), TimelineUtilityMethods::CreateTypedEntity(), ProfilingService::Instance(), ProfilingService::NextGuid(), TimelineUtilityMethods::RecordEvent(), armnn::profiling::RetentionLink, and LabelsAndEventClasses::WORKLOAD_EXECUTION_GUID.

Referenced by TimelineUtilityMethods::TimelineUtilityMethods().

399 {
400  ProfilingDynamicGuid workloadInferenceGuid = ProfilingService::Instance().NextGuid();
402  CreateRelationship(ProfilingRelationshipType::RetentionLink, inferenceGuid, workloadInferenceGuid);
403  CreateRelationship(ProfilingRelationshipType::RetentionLink, workloadGuid, workloadInferenceGuid);
405  return workloadInferenceGuid;
406 }
static ProfilingService & Instance()
ProfilingDynamicGuid NextGuid() override
Return the next random Guid in the sequence.
static ARMNN_DLLEXPORT ProfilingStaticGuid WORKLOAD_EXECUTION_GUID
static ARMNN_DLLEXPORT ProfilingStaticGuid ARMNN_PROFILING_SOL_EVENT_CLASS
void CreateTypedEntity(ProfilingGuid entityGuid, ProfilingStaticGuid typeGuid)
ProfilingDynamicGuid RecordEvent(ProfilingGuid entityGuid, ProfilingStaticGuid eventClassGuid)
ProfilingDynamicGuid CreateRelationship(ProfilingRelationshipType relationshipType, ProfilingGuid headGuid, ProfilingGuid tailGuid)

◆ SendWellKnownLabelsAndEventClasses()

void SendWellKnownLabelsAndEventClasses ( )

Definition at line 31 of file TimelineUtilityMethods.cpp.

References LabelsAndEventClasses::ARMNN_PROFILING_EOL_EVENT_CLASS, LabelsAndEventClasses::ARMNN_PROFILING_SOL_EVENT_CLASS, LabelsAndEventClasses::BACKENDID_GUID, LabelsAndEventClasses::BACKENDID_LABEL, LabelsAndEventClasses::CONNECTION, LabelsAndEventClasses::CONNECTION_GUID, LabelsAndEventClasses::INDEX_GUID, LabelsAndEventClasses::INDEX_LABEL, LabelsAndEventClasses::INFERENCE, LabelsAndEventClasses::INFERENCE_GUID, LabelsAndEventClasses::LAYER, LabelsAndEventClasses::LAYER_GUID, LabelsAndEventClasses::NAME_GUID, LabelsAndEventClasses::NAME_LABEL, LabelsAndEventClasses::NETWORK, LabelsAndEventClasses::NETWORK_GUID, LabelsAndEventClasses::TYPE_GUID, LabelsAndEventClasses::TYPE_LABEL, LabelsAndEventClasses::WORKLOAD, LabelsAndEventClasses::WORKLOAD_EXECUTION, LabelsAndEventClasses::WORKLOAD_EXECUTION_GUID, and LabelsAndEventClasses::WORKLOAD_GUID.

Referenced by TimelineUtilityMethods::TimelineUtilityMethods().

32 {
33  // Send the "name" label, this call throws in case of error
34  m_SendTimelinePacket->SendTimelineLabelBinaryPacket(LabelsAndEventClasses::NAME_GUID,
36 
37  // Send the "type" label, this call throws in case of error
38  m_SendTimelinePacket->SendTimelineLabelBinaryPacket(LabelsAndEventClasses::TYPE_GUID,
40 
41  // Send the "index" label, this call throws in case of error
42  m_SendTimelinePacket->SendTimelineLabelBinaryPacket(LabelsAndEventClasses::INDEX_GUID,
44 
45  // Send the "backendId" label, this call throws in case of error
46  m_SendTimelinePacket->SendTimelineLabelBinaryPacket(LabelsAndEventClasses::BACKENDID_GUID,
48 
49  // Send the "layer" label, this call throws in case of error
50  m_SendTimelinePacket->SendTimelineLabelBinaryPacket(LabelsAndEventClasses::LAYER_GUID,
52 
53  // Send the "workload" label, this call throws in case of error
54  m_SendTimelinePacket->SendTimelineLabelBinaryPacket(LabelsAndEventClasses::WORKLOAD_GUID,
56 
57  // Send the "network" label, this call throws in case of error
58  m_SendTimelinePacket->SendTimelineLabelBinaryPacket(LabelsAndEventClasses::NETWORK_GUID,
60 
61  // Send the "connection" label, this call throws in case of error
62  m_SendTimelinePacket->SendTimelineLabelBinaryPacket(LabelsAndEventClasses::CONNECTION_GUID,
64 
65  // Send the "inference" label, this call throws in case of error
66  m_SendTimelinePacket->SendTimelineLabelBinaryPacket(LabelsAndEventClasses::INFERENCE_GUID,
68 
69  // Send the "workload_execution" label, this call throws in case of error
70  m_SendTimelinePacket->SendTimelineLabelBinaryPacket(LabelsAndEventClasses::WORKLOAD_EXECUTION_GUID,
72 
73  // Send the "start of life" event class, this call throws in case of error
74  m_SendTimelinePacket->SendTimelineEventClassBinaryPacket(LabelsAndEventClasses::ARMNN_PROFILING_SOL_EVENT_CLASS);
75 
76  // Send the "end of life" event class, this call throws in case of error
77  m_SendTimelinePacket->SendTimelineEventClassBinaryPacket(LabelsAndEventClasses::ARMNN_PROFILING_EOL_EVENT_CLASS);
78 }
static ARMNN_DLLEXPORT ProfilingStaticGuid INFERENCE_GUID
static ARMNN_DLLEXPORT std::string WORKLOAD_EXECUTION
static ARMNN_DLLEXPORT std::string TYPE_LABEL
static ARMNN_DLLEXPORT std::string NAME_LABEL
static ARMNN_DLLEXPORT std::string BACKENDID_LABEL
static ARMNN_DLLEXPORT ProfilingStaticGuid CONNECTION_GUID
static ARMNN_DLLEXPORT ProfilingStaticGuid WORKLOAD_GUID
static ARMNN_DLLEXPORT ProfilingStaticGuid WORKLOAD_EXECUTION_GUID
static ARMNN_DLLEXPORT ProfilingStaticGuid ARMNN_PROFILING_EOL_EVENT_CLASS
static ARMNN_DLLEXPORT ProfilingStaticGuid NAME_GUID
static ARMNN_DLLEXPORT ProfilingStaticGuid ARMNN_PROFILING_SOL_EVENT_CLASS
static ARMNN_DLLEXPORT std::string NETWORK
static ARMNN_DLLEXPORT ProfilingStaticGuid LAYER_GUID
static ARMNN_DLLEXPORT std::string WORKLOAD
static ARMNN_DLLEXPORT std::string INDEX_LABEL
static ARMNN_DLLEXPORT ProfilingStaticGuid NETWORK_GUID
static ARMNN_DLLEXPORT std::string CONNECTION
static ARMNN_DLLEXPORT ProfilingStaticGuid INDEX_GUID
static ARMNN_DLLEXPORT ProfilingStaticGuid TYPE_GUID
static ARMNN_DLLEXPORT ProfilingStaticGuid BACKENDID_GUID
static ARMNN_DLLEXPORT std::string INFERENCE
static ARMNN_DLLEXPORT std::string LAYER

◆ TypeEntity()

void TypeEntity ( ProfilingGuid  entityGuid,
const std::string &  type 
)

Definition at line 226 of file TimelineUtilityMethods.cpp.

References TimelineUtilityMethods::MarkEntityWithLabel(), and LabelsAndEventClasses::TYPE_GUID.

Referenced by TimelineUtilityMethods::CreateNamedTypedEntity(), and TimelineUtilityMethods::TimelineUtilityMethods().

227 {
229 }
void MarkEntityWithLabel(ProfilingGuid entityGuid, const std::string &labelName, ProfilingStaticGuid labelLinkGuid)
static ARMNN_DLLEXPORT ProfilingStaticGuid TYPE_GUID

The documentation for this class was generated from the following files: