1 // 2 // Copyright © 2019 Arm Ltd and Contributors. All rights reserved. 3 // SPDX-License-Identifier: MIT 4 // 5 6 #pragma once 7 8 #include <algorithm> 9 #include <string> 10 #include <vector> 11 12 namespace arm 13 { 14 15 namespace pipe 16 { 17 18 enum class ProfilingRelationshipType 19 { 20 RetentionLink, /// Head retains(parents) Tail 21 ExecutionLink, /// Head execution start depends on Tail execution completion 22 DataLink, /// Head uses data of Tail 23 LabelLink /// Head uses label Tail (Tail MUST be a guid of a label). 24 }; 25 26 class ISendTimelinePacket 27 { 28 public: ~ISendTimelinePacket()29 virtual ~ISendTimelinePacket() 30 {} 31 32 /// Commits the current buffer and reset the member variables 33 virtual void Commit() = 0; 34 35 /// Create and write a TimelineEntityBinaryPacket from the parameters to the buffer. 36 virtual void SendTimelineEntityBinaryPacket(uint64_t profilingGuid) = 0; 37 38 /// Create and write a TimelineEventBinaryPacket from the parameters to the buffer. 39 virtual void 40 SendTimelineEventBinaryPacket(uint64_t timestamp, int threadId, uint64_t profilingGuid) = 0; 41 42 /// Create and write a TimelineEventClassBinaryPacket from the parameters to the buffer. 43 virtual void SendTimelineEventClassBinaryPacket(uint64_t profilingGuid, uint64_t nameGuid) = 0; 44 45 /// Create and write a TimelineLabelBinaryPacket from the parameters to the buffer. 46 virtual void SendTimelineLabelBinaryPacket(uint64_t profilingGuid, const std::string& label) = 0; 47 48 /// Create and write a TimelineMessageDirectoryPackage in the buffer 49 virtual void SendTimelineMessageDirectoryPackage() = 0; 50 51 /// Create and write a TimelineRelationshipBinaryPacket from the parameters to the buffer. 52 virtual void SendTimelineRelationshipBinaryPacket(ProfilingRelationshipType relationshipType, 53 uint64_t relationshipGuid, 54 uint64_t headGuid, 55 uint64_t tailGuid, 56 uint64_t attributeGuid) = 0; 57 }; 58 59 } // namespace pipe 60 61 } // namespace arm 62