blob: 8a39ea7c4a35f651c99214962d69e462507e8cd4 [file] [log] [blame]
Matteo Martincigh830101c2019-10-22 11:07:45 +01001//
2// Copyright © 2019 Arm Ltd. All rights reserved.
3// SPDX-License-Identifier: MIT
4//
5
6#include "TimelineUtilityMethods.hpp"
Matteo Martincigh102cdbd2019-10-28 11:42:50 +00007#include "LabelsAndEventClasses.hpp"
Matteo Martincigh830101c2019-10-22 11:07:45 +01008
9namespace armnn
10{
11
12namespace profiling
13{
14
Sadik Armagan3184c902020-03-18 10:57:30 +000015std::unique_ptr<TimelineUtilityMethods> TimelineUtilityMethods::GetTimelineUtils(ProfilingService& profilingService)
Narumol Prangnawaratdf31cfe2019-11-22 11:26:06 +000016{
Sadik Armagan3184c902020-03-18 10:57:30 +000017 if (profilingService.IsProfilingEnabled())
Narumol Prangnawaratdf31cfe2019-11-22 11:26:06 +000018 {
Sadik Armagan3184c902020-03-18 10:57:30 +000019 std::unique_ptr<ISendTimelinePacket> sendTimelinepacket = profilingService.GetSendTimelinePacket();
Sadik Armagan0a356672020-03-20 11:11:01 +000020 return std::make_unique<TimelineUtilityMethods>(sendTimelinepacket);
Narumol Prangnawaratdf31cfe2019-11-22 11:26:06 +000021 }
22 else
23 {
24 std::unique_ptr<TimelineUtilityMethods> empty;
25 return empty;
26 }
27}
28
29
Finn Williamscf2ad552020-03-20 15:10:59 +000030void TimelineUtilityMethods::SendWellKnownLabelsAndEventClasses(ISendTimelinePacket& timelinePacket)
Matteo Martincigh102cdbd2019-10-28 11:42:50 +000031{
32 // Send the "name" label, this call throws in case of error
Finn Williamscf2ad552020-03-20 15:10:59 +000033 timelinePacket.SendTimelineLabelBinaryPacket(LabelsAndEventClasses::NAME_GUID,
Narumol Prangnawaratdf31cfe2019-11-22 11:26:06 +000034 LabelsAndEventClasses::NAME_LABEL);
Matteo Martincigh102cdbd2019-10-28 11:42:50 +000035
36 // Send the "type" label, this call throws in case of error
Finn Williamscf2ad552020-03-20 15:10:59 +000037 timelinePacket.SendTimelineLabelBinaryPacket(LabelsAndEventClasses::TYPE_GUID,
Narumol Prangnawaratdf31cfe2019-11-22 11:26:06 +000038 LabelsAndEventClasses::TYPE_LABEL);
Matteo Martincigh102cdbd2019-10-28 11:42:50 +000039
40 // Send the "index" label, this call throws in case of error
Finn Williamscf2ad552020-03-20 15:10:59 +000041 timelinePacket.SendTimelineLabelBinaryPacket(LabelsAndEventClasses::INDEX_GUID,
Narumol Prangnawaratdf31cfe2019-11-22 11:26:06 +000042 LabelsAndEventClasses::INDEX_LABEL);
43
44 // Send the "backendId" label, this call throws in case of error
Finn Williamscf2ad552020-03-20 15:10:59 +000045 timelinePacket.SendTimelineLabelBinaryPacket(LabelsAndEventClasses::BACKENDID_GUID,
Narumol Prangnawaratdf31cfe2019-11-22 11:26:06 +000046 LabelsAndEventClasses::BACKENDID_LABEL);
47
48 // Send the "layer" label, this call throws in case of error
Finn Williamscf2ad552020-03-20 15:10:59 +000049 timelinePacket.SendTimelineLabelBinaryPacket(LabelsAndEventClasses::LAYER_GUID,
Narumol Prangnawaratdf31cfe2019-11-22 11:26:06 +000050 LabelsAndEventClasses::LAYER);
51
52 // Send the "workload" label, this call throws in case of error
Finn Williamscf2ad552020-03-20 15:10:59 +000053 timelinePacket.SendTimelineLabelBinaryPacket(LabelsAndEventClasses::WORKLOAD_GUID,
Narumol Prangnawaratdf31cfe2019-11-22 11:26:06 +000054 LabelsAndEventClasses::WORKLOAD);
55
56 // Send the "network" label, this call throws in case of error
Finn Williamscf2ad552020-03-20 15:10:59 +000057 timelinePacket.SendTimelineLabelBinaryPacket(LabelsAndEventClasses::NETWORK_GUID,
Narumol Prangnawaratdf31cfe2019-11-22 11:26:06 +000058 LabelsAndEventClasses::NETWORK);
59
60 // Send the "connection" label, this call throws in case of error
Finn Williamscf2ad552020-03-20 15:10:59 +000061 timelinePacket.SendTimelineLabelBinaryPacket(LabelsAndEventClasses::CONNECTION_GUID,
Narumol Prangnawaratdf31cfe2019-11-22 11:26:06 +000062 LabelsAndEventClasses::CONNECTION);
Matteo Martincigh102cdbd2019-10-28 11:42:50 +000063
David Monahan6198fe02019-12-02 08:35:43 +000064 // Send the "inference" label, this call throws in case of error
Finn Williamscf2ad552020-03-20 15:10:59 +000065 timelinePacket.SendTimelineLabelBinaryPacket(LabelsAndEventClasses::INFERENCE_GUID,
David Monahan6198fe02019-12-02 08:35:43 +000066 LabelsAndEventClasses::INFERENCE);
67
68 // Send the "workload_execution" label, this call throws in case of error
Finn Williamscf2ad552020-03-20 15:10:59 +000069 timelinePacket.SendTimelineLabelBinaryPacket(LabelsAndEventClasses::WORKLOAD_EXECUTION_GUID,
David Monahan6198fe02019-12-02 08:35:43 +000070 LabelsAndEventClasses::WORKLOAD_EXECUTION);
71
Matteo Martincigh102cdbd2019-10-28 11:42:50 +000072 // Send the "start of life" event class, this call throws in case of error
Finn Williamscf2ad552020-03-20 15:10:59 +000073 timelinePacket.SendTimelineEventClassBinaryPacket(LabelsAndEventClasses::ARMNN_PROFILING_SOL_EVENT_CLASS);
Matteo Martincigh102cdbd2019-10-28 11:42:50 +000074
75 // Send the "end of life" event class, this call throws in case of error
Finn Williamscf2ad552020-03-20 15:10:59 +000076 timelinePacket.SendTimelineEventClassBinaryPacket(LabelsAndEventClasses::ARMNN_PROFILING_EOL_EVENT_CLASS);
77
78 timelinePacket.Commit();
Matteo Martincigh102cdbd2019-10-28 11:42:50 +000079}
80
Narumol Prangnawaratd034e082019-10-30 12:48:31 +000081ProfilingDynamicGuid TimelineUtilityMethods::CreateNamedTypedEntity(const std::string& name, const std::string& type)
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
Sadik Armagan0a356672020-03-20 11:11:01 +000096 ProfilingDynamicGuid entityGuid = profiling::ProfilingService::GetNextGuid();
Narumol Prangnawaratd034e082019-10-30 12:48:31 +000097
Narumol Prangnawarat234d5252019-11-19 15:49:18 +000098 CreateNamedTypedEntity(entityGuid, name, type);
99
100 return entityGuid;
101}
102
Narumol Prangnawaratdf31cfe2019-11-22 11:26:06 +0000103void TimelineUtilityMethods::CreateNamedTypedEntity(ProfilingGuid entityGuid,
Narumol Prangnawarat234d5252019-11-19 15:49:18 +0000104 const std::string& name,
105 const std::string& type)
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
Narumol Prangnawaratd034e082019-10-30 12:48:31 +0000119 // Send Entity Binary Packet of the entity to the external profiling service
Narumol Prangnawaratdf31cfe2019-11-22 11:26:06 +0000120 m_SendTimelinePacket->SendTimelineEntityBinaryPacket(entityGuid);
Narumol Prangnawaratd034e082019-10-30 12:48:31 +0000121
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);
Narumol Prangnawaratd034e082019-10-30 12:48:31 +0000127}
128
Narumol Prangnawaratdf31cfe2019-11-22 11:26:06 +0000129void TimelineUtilityMethods::CreateNamedTypedEntity(ProfilingGuid entityGuid,
130 const std::string& name,
131 ProfilingStaticGuid typeGuid)
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}
148
Matteo Martincigh830101c2019-10-22 11:07:45 +0100149ProfilingStaticGuid TimelineUtilityMethods::DeclareLabel(const std::string& labelName)
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
Sadik Armagan0a356672020-03-20 11:11:01 +0000159 ProfilingStaticGuid labelGuid = profiling::ProfilingService::GetStaticId(labelName);
Matteo Martincigh830101c2019-10-22 11:07:45 +0100160
161 // Send the new label to the external profiling service, this call throws in case of error
Narumol Prangnawaratdf31cfe2019-11-22 11:26:06 +0000162 m_SendTimelinePacket->SendTimelineLabelBinaryPacket(labelGuid, labelName);
Matteo Martincigh830101c2019-10-22 11:07:45 +0100163
164 return labelGuid;
165}
166
Narumol Prangnawaratdf31cfe2019-11-22 11:26:06 +0000167void TimelineUtilityMethods::MarkEntityWithLabel(ProfilingGuid entityGuid,
168 const std::string& labelName,
169 ProfilingStaticGuid labelTypeGuid)
Matteo Martincighc0401992019-10-28 15:24:34 +0000170{
Narumol Prangnawaratdf31cfe2019-11-22 11:26:06 +0000171 // Check that the label name is valid
172 if (labelName.empty())
Matteo Martincighc0401992019-10-28 15:24:34 +0000173 {
Narumol Prangnawaratdf31cfe2019-11-22 11:26:06 +0000174 // The label name is invalid
Matteo Martincighc0401992019-10-28 15:24:34 +0000175 throw InvalidArgumentException("Invalid entity name, the entity name cannot be empty");
176 }
177
Narumol Prangnawaratdf31cfe2019-11-22 11:26:06 +0000178 // Declare a label with the label's name, this call throws in case of error
179 ProfilingStaticGuid labelGuid = DeclareLabel(labelName);
Matteo Martincighc0401992019-10-28 15:24:34 +0000180
181 // Generate a GUID for the label relationship
Sadik Armagan0a356672020-03-20 11:11:01 +0000182 ProfilingDynamicGuid relationshipGuid = profiling::ProfilingService::GetNextGuid();
Matteo Martincighc0401992019-10-28 15:24:34 +0000183
184 // Send the new label link to the external profiling service, this call throws in case of error
Narumol Prangnawaratdf31cfe2019-11-22 11:26:06 +0000185 m_SendTimelinePacket->SendTimelineRelationshipBinaryPacket(ProfilingRelationshipType::LabelLink,
186 relationshipGuid,
187 entityGuid,
188 labelGuid);
Matteo Martincighc0401992019-10-28 15:24:34 +0000189
190 // Generate a GUID for the label relationship
Sadik Armagan0a356672020-03-20 11:11:01 +0000191 ProfilingDynamicGuid relationshipLabelGuid = profiling::ProfilingService::GetNextGuid();
Matteo Martincighc0401992019-10-28 15:24:34 +0000192
193 // Send the new label link to the external profiling service, this call throws in case of error
Narumol Prangnawaratdf31cfe2019-11-22 11:26:06 +0000194 m_SendTimelinePacket->SendTimelineRelationshipBinaryPacket(ProfilingRelationshipType::LabelLink,
195 relationshipLabelGuid,
196 relationshipGuid,
197 labelTypeGuid);
198}
199
200void TimelineUtilityMethods::MarkEntityWithType(ProfilingGuid entityGuid,
201 ProfilingStaticGuid typeNameGuid)
202{
203 // Generate a GUID for the label relationship
Sadik Armagan0a356672020-03-20 11:11:01 +0000204 ProfilingDynamicGuid relationshipGuid = profiling::ProfilingService::GetNextGuid();
Narumol Prangnawaratdf31cfe2019-11-22 11:26:06 +0000205
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
Sadik Armagan0a356672020-03-20 11:11:01 +0000213 ProfilingDynamicGuid relationshipLabelGuid = profiling::ProfilingService::GetNextGuid();
Narumol Prangnawaratdf31cfe2019-11-22 11:26:06 +0000214
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,
219 LabelsAndEventClasses::TYPE_GUID);
Matteo Martincighc0401992019-10-28 15:24:34 +0000220}
221
Narumol Prangnawaratd034e082019-10-30 12:48:31 +0000222void TimelineUtilityMethods::NameEntity(ProfilingGuid entityGuid, const std::string& name)
223{
Narumol Prangnawaratdf31cfe2019-11-22 11:26:06 +0000224 MarkEntityWithLabel(entityGuid, name, LabelsAndEventClasses::NAME_GUID);
Narumol Prangnawaratd034e082019-10-30 12:48:31 +0000225}
226
227void TimelineUtilityMethods::TypeEntity(ProfilingGuid entityGuid, const std::string& type)
228{
Narumol Prangnawaratdf31cfe2019-11-22 11:26:06 +0000229 MarkEntityWithLabel(entityGuid, type, LabelsAndEventClasses::TYPE_GUID);
Narumol Prangnawaratd034e082019-10-30 12:48:31 +0000230}
231
Narumol Prangnawarat94a30882019-10-30 12:48:31 +0000232ProfilingDynamicGuid TimelineUtilityMethods::CreateNamedTypedChildEntity(ProfilingGuid parentEntityGuid,
233 const std::string& entityName,
234 const std::string& entityType)
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
Sadik Armagan0a356672020-03-20 11:11:01 +0000254 ProfilingDynamicGuid retentionLinkGuid = profiling::ProfilingService::GetNextGuid();
Narumol Prangnawarat94a30882019-10-30 12:48:31 +0000255
256 // Send the new retention link to the external profiling service, this call throws in case of error
Narumol Prangnawaratdf31cfe2019-11-22 11:26:06 +0000257 m_SendTimelinePacket->SendTimelineRelationshipBinaryPacket(ProfilingRelationshipType::RetentionLink,
258 retentionLinkGuid,
259 parentEntityGuid,
260 childEntityGuid);
Narumol Prangnawarat94a30882019-10-30 12:48:31 +0000261
262 return childEntityGuid;
263}
264
Narumol Prangnawaratdf31cfe2019-11-22 11:26:06 +0000265void TimelineUtilityMethods::CreateNamedTypedChildEntity(ProfilingGuid childEntityGuid,
Narumol Prangnawarat234d5252019-11-19 15:49:18 +0000266 ProfilingGuid parentEntityGuid,
267 const std::string& entityName,
268 const std::string& entityType)
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
Sadik Armagan0a356672020-03-20 11:11:01 +0000288 ProfilingDynamicGuid retentionLinkGuid = profiling::ProfilingService::GetNextGuid();
Narumol Prangnawarat234d5252019-11-19 15:49:18 +0000289
290 // Send the new retention link to the external profiling service, this call throws in case of error
Narumol Prangnawaratdf31cfe2019-11-22 11:26:06 +0000291 m_SendTimelinePacket->SendTimelineRelationshipBinaryPacket(ProfilingRelationshipType::RetentionLink,
292 retentionLinkGuid,
293 parentEntityGuid,
294 childEntityGuid);
295}
296
297void TimelineUtilityMethods::CreateNamedTypedChildEntity(ProfilingGuid childEntityGuid,
298 ProfilingGuid parentEntityGuid,
299 const std::string& entityName,
300 ProfilingStaticGuid typeGuid)
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
Sadik Armagan0a356672020-03-20 11:11:01 +0000313 ProfilingDynamicGuid retentionLinkGuid = profiling::ProfilingService::GetNextGuid();
Narumol Prangnawaratdf31cfe2019-11-22 11:26:06 +0000314
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}
321
322ProfilingDynamicGuid TimelineUtilityMethods::CreateRelationship(ProfilingRelationshipType relationshipType,
323 ProfilingGuid headGuid,
324 ProfilingGuid tailGuid)
325{
326 // Generate a GUID for the relationship
Sadik Armagan0a356672020-03-20 11:11:01 +0000327 ProfilingDynamicGuid relationshipGuid = profiling::ProfilingService::GetNextGuid();
Narumol Prangnawaratdf31cfe2019-11-22 11:26:06 +0000328
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}
336
337ProfilingDynamicGuid TimelineUtilityMethods::CreateConnectionRelationship(ProfilingRelationshipType relationshipType,
338 ProfilingGuid headGuid,
339 ProfilingGuid tailGuid)
340{
341 // Generate a GUID for the relationship
Sadik Armagan0a356672020-03-20 11:11:01 +0000342 ProfilingDynamicGuid relationshipGuid = profiling::ProfilingService::GetNextGuid();
Narumol Prangnawaratdf31cfe2019-11-22 11:26:06 +0000343
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
350 MarkEntityWithType(relationshipGuid, LabelsAndEventClasses::CONNECTION_GUID);
351 return relationshipGuid;
352}
353
354void TimelineUtilityMethods::CreateTypedEntity(ProfilingGuid entityGuid, ProfilingStaticGuid entityTypeGuid)
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);
Narumol Prangnawarat234d5252019-11-19 15:49:18 +0000361}
362
Matteo Martincigh5dc816e2019-11-04 14:05:28 +0000363ProfilingDynamicGuid TimelineUtilityMethods::RecordEvent(ProfilingGuid entityGuid, ProfilingStaticGuid eventClassGuid)
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
Sadik Armagan0a356672020-03-20 11:11:01 +0000372 ProfilingDynamicGuid eventGuid = profiling::ProfilingService::GetNextGuid();
Matteo Martincigh5dc816e2019-11-04 14:05:28 +0000373
374 // Send the new timeline event to the external profiling service, this call throws in case of error
Narumol Prangnawaratdf31cfe2019-11-22 11:26:06 +0000375 m_SendTimelinePacket->SendTimelineEventBinaryPacket(timestamp, threadId, eventGuid);
Matteo Martincigh5dc816e2019-11-04 14:05:28 +0000376
377 // Generate a GUID for the execution link
Sadik Armagan0a356672020-03-20 11:11:01 +0000378 ProfilingDynamicGuid executionLinkId = profiling::ProfilingService::GetNextGuid();
Matteo Martincigh5dc816e2019-11-04 14:05:28 +0000379
380 // Send the new execution link to the external profiling service, this call throws in case of error
Narumol Prangnawaratdf31cfe2019-11-22 11:26:06 +0000381 m_SendTimelinePacket->SendTimelineRelationshipBinaryPacket(ProfilingRelationshipType::ExecutionLink,
382 executionLinkId,
383 entityGuid,
384 eventGuid);
Matteo Martincigh5dc816e2019-11-04 14:05:28 +0000385
386 // Generate a GUID for the data relationship link
Sadik Armagan0a356672020-03-20 11:11:01 +0000387 ProfilingDynamicGuid eventClassLinkId = profiling::ProfilingService::GetNextGuid();
Matteo Martincigh5dc816e2019-11-04 14:05:28 +0000388
389 // Send the new data relationship link to the external profiling service, this call throws in case of error
Narumol Prangnawaratdf31cfe2019-11-22 11:26:06 +0000390 m_SendTimelinePacket->SendTimelineRelationshipBinaryPacket(ProfilingRelationshipType::DataLink,
391 eventClassLinkId,
392 eventGuid,
393 eventClassGuid);
Matteo Martincigh5dc816e2019-11-04 14:05:28 +0000394
395 return eventGuid;
396}
397
David Monahan6198fe02019-12-02 08:35:43 +0000398ProfilingDynamicGuid TimelineUtilityMethods::RecordWorkloadInferenceAndStartOfLifeEvent(ProfilingGuid workloadGuid,
399 ProfilingGuid inferenceGuid)
400{
Sadik Armagan0a356672020-03-20 11:11:01 +0000401 ProfilingDynamicGuid workloadInferenceGuid = profiling::ProfilingService::GetNextGuid();
David Monahan6198fe02019-12-02 08:35:43 +0000402 CreateTypedEntity(workloadInferenceGuid, LabelsAndEventClasses::WORKLOAD_EXECUTION_GUID);
403 CreateRelationship(ProfilingRelationshipType::RetentionLink, inferenceGuid, workloadInferenceGuid);
404 CreateRelationship(ProfilingRelationshipType::RetentionLink, workloadGuid, workloadInferenceGuid);
405 RecordEvent(workloadInferenceGuid, LabelsAndEventClasses::ARMNN_PROFILING_SOL_EVENT_CLASS);
406 return workloadInferenceGuid;
407}
408
409void TimelineUtilityMethods::RecordEndOfLifeEvent(ProfilingGuid entityGuid)
410{
411 RecordEvent(entityGuid, LabelsAndEventClasses::ARMNN_PROFILING_EOL_EVENT_CLASS);
412}
413
Matteo Martincigh830101c2019-10-22 11:07:45 +0100414} // namespace profiling
415
416} // namespace armnn