ArmNN
 20.05
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
 
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 (ProfilingService &profilingService)
 
static void SendWellKnownLabelsAndEventClasses (ISendTimelinePacket &timelinePacket)
 

Detailed Description

Definition at line 19 of file TimelineUtilityMethods.hpp.

Constructor & Destructor Documentation

◆ TimelineUtilityMethods() [1/3]

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

Definition at line 27 of file TimelineUtilityMethods.hpp.

Referenced by TimelineUtilityMethods::TimelineUtilityMethods().

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

◆ TimelineUtilityMethods() [2/3]

◆ TimelineUtilityMethods() [3/3]

◆ ~TimelineUtilityMethods()

Member Function Documentation

◆ Commit()

void Commit ( )
inline

Definition at line 91 of file TimelineUtilityMethods.hpp.

91 { m_SendTimelinePacket->Commit(); }

◆ CreateConnectionRelationship()

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

Definition at line 337 of file TimelineUtilityMethods.cpp.

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

Referenced by TimelineUtilityMethods::TimelineUtilityMethods().

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

◆ CreateNamedTypedChildEntity() [1/3]

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

Definition at line 232 of file TimelineUtilityMethods.cpp.

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

Referenced by TimelineUtilityMethods::TimelineUtilityMethods().

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

◆ CreateNamedTypedChildEntity() [2/3]

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

Definition at line 265 of file TimelineUtilityMethods.cpp.

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

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

◆ CreateNamedTypedChildEntity() [3/3]

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

Definition at line 297 of file TimelineUtilityMethods.cpp.

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

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

◆ CreateNamedTypedEntity() [1/3]

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

Definition at line 81 of file TimelineUtilityMethods.cpp.

References ProfilingService::GetNextGuid().

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

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

◆ CreateNamedTypedEntity() [2/3]

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

Definition at line 103 of file TimelineUtilityMethods.cpp.

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

106 {
107  // Check that the entity name is valid
108  if (name.empty())
109  {
110  throw InvalidArgumentException("Invalid entity name, the entity name cannot be empty");
111  }
112 
113  // Check that the entity type is valid
114  if (type.empty())
115  {
116  throw InvalidArgumentException("Invalid entity type, the entity type cannot be empty");
117  }
118 
119  // Send Entity Binary Packet of the entity to the external profiling service
120  m_SendTimelinePacket->SendTimelineEntityBinaryPacket(entityGuid);
121 
122  // Create name entity and send the relationship of the entity with the given name
123  NameEntity(entityGuid, name);
124 
125  // Create type entity and send the relationship of the entity with the given type
126  TypeEntity(entityGuid, type);
127 }
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 129 of file TimelineUtilityMethods.cpp.

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

132 {
133  // Check that the entity name is valid
134  if (name.empty())
135  {
136  throw InvalidArgumentException("Invalid entity name, the entity name cannot be empty");
137  }
138 
139  // Send Entity Binary Packet of the entity to the external profiling service
140  m_SendTimelinePacket->SendTimelineEntityBinaryPacket(entityGuid);
141 
142  // Create name entity and send the relationship of the entity with the given name
143  NameEntity(entityGuid, name);
144 
145  // Create type entity and send the relationship of the entity with the given type
146  MarkEntityWithType(entityGuid, typeGuid);
147 }
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 322 of file TimelineUtilityMethods.cpp.

References ProfilingService::GetNextGuid().

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

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

◆ CreateTypedEntity()

void CreateTypedEntity ( ProfilingGuid  entityGuid,
ProfilingStaticGuid  typeGuid 
)

Definition at line 354 of file TimelineUtilityMethods.cpp.

References TimelineUtilityMethods::MarkEntityWithType().

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

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

◆ DeclareLabel()

ProfilingStaticGuid DeclareLabel ( const std::string &  labelName)

Definition at line 149 of file TimelineUtilityMethods.cpp.

References ProfilingService::GetStaticId().

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

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

◆ GetTimelineUtils()

std::unique_ptr< TimelineUtilityMethods > GetTimelineUtils ( ProfilingService profilingService)
static

Definition at line 15 of file TimelineUtilityMethods.cpp.

References armnn::profiling::Active, ProfilingService::GetCurrentState(), ProfilingService::GetSendTimelinePacket(), and ProfilingService::IsTimelineReportingEnabled().

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

16 {
18  {
19  std::unique_ptr<ISendTimelinePacket> sendTimelinepacket = profilingService.GetSendTimelinePacket();
20  return std::make_unique<TimelineUtilityMethods>(sendTimelinepacket);
21  }
22  else
23  {
24  std::unique_ptr<TimelineUtilityMethods> empty;
25  return empty;
26  }
27 }
ProfilingState GetCurrentState() const
std::unique_ptr< ISendTimelinePacket > GetSendTimelinePacket() const override
armnn::profiling::ProfilingService profilingService

◆ MarkEntityWithLabel()

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

Definition at line 167 of file TimelineUtilityMethods.cpp.

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

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

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

◆ MarkEntityWithType()

void MarkEntityWithType ( ProfilingGuid  entityGuid,
ProfilingStaticGuid  typeNameGuid 
)

Definition at line 200 of file TimelineUtilityMethods.cpp.

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

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

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

◆ NameEntity()

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

Definition at line 222 of file TimelineUtilityMethods.cpp.

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

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

223 {
225 }
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 409 of file TimelineUtilityMethods.cpp.

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

Referenced by TimelineUtilityMethods::TimelineUtilityMethods().

410 {
412 }
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 363 of file TimelineUtilityMethods.cpp.

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

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

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

◆ RecordWorkloadInferenceAndStartOfLifeEvent()

ProfilingDynamicGuid RecordWorkloadInferenceAndStartOfLifeEvent ( ProfilingGuid  workloadGuid,
ProfilingGuid  inferenceGuid 
)

Definition at line 398 of file TimelineUtilityMethods.cpp.

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

Referenced by TimelineUtilityMethods::TimelineUtilityMethods().

400 {
401  ProfilingDynamicGuid workloadInferenceGuid = profiling::ProfilingService::GetNextGuid();
403  CreateRelationship(ProfilingRelationshipType::RetentionLink, inferenceGuid, workloadInferenceGuid);
404  CreateRelationship(ProfilingRelationshipType::RetentionLink, workloadGuid, workloadInferenceGuid);
406  return workloadInferenceGuid;
407 }
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)
static ProfilingDynamicGuid GetNextGuid()
ProfilingDynamicGuid CreateRelationship(ProfilingRelationshipType relationshipType, ProfilingGuid headGuid, ProfilingGuid tailGuid)

◆ SendWellKnownLabelsAndEventClasses()

void SendWellKnownLabelsAndEventClasses ( ISendTimelinePacket timelinePacket)
static

Definition at line 30 of file TimelineUtilityMethods.cpp.

References LabelsAndEventClasses::ARMNN_PROFILING_EOL_EVENT_CLASS, LabelsAndEventClasses::ARMNN_PROFILING_SOL_EVENT_CLASS, LabelsAndEventClasses::BACKENDID_GUID, LabelsAndEventClasses::BACKENDID_LABEL, ISendTimelinePacket::Commit(), 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, ISendTimelinePacket::SendTimelineEventClassBinaryPacket(), ISendTimelinePacket::SendTimelineLabelBinaryPacket(), LabelsAndEventClasses::TYPE_GUID, LabelsAndEventClasses::TYPE_LABEL, LabelsAndEventClasses::WORKLOAD, LabelsAndEventClasses::WORKLOAD_EXECUTION, LabelsAndEventClasses::WORKLOAD_EXECUTION_GUID, and LabelsAndEventClasses::WORKLOAD_GUID.

Referenced by BOOST_AUTO_TEST_CASE(), ConnectionAcknowledgedCommandHandler::operator()(), ActivateTimelineReportingCommandHandler::operator()(), and TimelineUtilityMethods::TimelineUtilityMethods().

31 {
32  // Send the "name" label, this call throws in case of error
33  timelinePacket.SendTimelineLabelBinaryPacket(LabelsAndEventClasses::NAME_GUID,
35 
36  // Send the "type" label, this call throws in case of error
37  timelinePacket.SendTimelineLabelBinaryPacket(LabelsAndEventClasses::TYPE_GUID,
39 
40  // Send the "index" label, this call throws in case of error
41  timelinePacket.SendTimelineLabelBinaryPacket(LabelsAndEventClasses::INDEX_GUID,
43 
44  // Send the "backendId" label, this call throws in case of error
45  timelinePacket.SendTimelineLabelBinaryPacket(LabelsAndEventClasses::BACKENDID_GUID,
47 
48  // Send the "layer" label, this call throws in case of error
49  timelinePacket.SendTimelineLabelBinaryPacket(LabelsAndEventClasses::LAYER_GUID,
51 
52  // Send the "workload" label, this call throws in case of error
53  timelinePacket.SendTimelineLabelBinaryPacket(LabelsAndEventClasses::WORKLOAD_GUID,
55 
56  // Send the "network" label, this call throws in case of error
57  timelinePacket.SendTimelineLabelBinaryPacket(LabelsAndEventClasses::NETWORK_GUID,
59 
60  // Send the "connection" label, this call throws in case of error
61  timelinePacket.SendTimelineLabelBinaryPacket(LabelsAndEventClasses::CONNECTION_GUID,
63 
64  // Send the "inference" label, this call throws in case of error
65  timelinePacket.SendTimelineLabelBinaryPacket(LabelsAndEventClasses::INFERENCE_GUID,
67 
68  // Send the "workload_execution" label, this call throws in case of error
69  timelinePacket.SendTimelineLabelBinaryPacket(LabelsAndEventClasses::WORKLOAD_EXECUTION_GUID,
71 
72  // Send the "start of life" event class, this call throws in case of error
73  timelinePacket.SendTimelineEventClassBinaryPacket(LabelsAndEventClasses::ARMNN_PROFILING_SOL_EVENT_CLASS);
74 
75  // Send the "end of life" event class, this call throws in case of error
76  timelinePacket.SendTimelineEventClassBinaryPacket(LabelsAndEventClasses::ARMNN_PROFILING_EOL_EVENT_CLASS);
77 
78  timelinePacket.Commit();
79 }
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 227 of file TimelineUtilityMethods.cpp.

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

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

228 {
230 }
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: