blob: 4785e04ef8daa9d5236238b31caa08ce28550b09 [file] [log] [blame]
Sadik Armagan7bbdf9d2019-10-24 10:26:05 +01001//
Jim Flynn1fdeb992020-07-09 07:28:37 +01002// Copyright © 2019 Arm Ltd and Contributors. All rights reserved.
Sadik Armagan7bbdf9d2019-10-24 10:26:05 +01003// SPDX-License-Identifier: MIT
4//
5
6#pragma once
7
Sadik Armagan7bbdf9d2019-10-24 10:26:05 +01008#include <algorithm>
9#include <string>
Colm Donelan5ccb33d2020-01-24 16:27:02 +000010#include <vector>
Sadik Armagan7bbdf9d2019-10-24 10:26:05 +010011
Cathal Corbett5aa9fd72022-02-25 15:33:28 +000012namespace arm
Sadik Armagan7bbdf9d2019-10-24 10:26:05 +010013{
14
Cathal Corbett5aa9fd72022-02-25 15:33:28 +000015namespace pipe
Sadik Armagan7bbdf9d2019-10-24 10:26:05 +010016{
17
Colm Donelan5ccb33d2020-01-24 16:27:02 +000018enum 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
Sadik Armagan7bbdf9d2019-10-24 10:26:05 +010026class ISendTimelinePacket
27{
28public:
Colm Donelan5ccb33d2020-01-24 16:27:02 +000029 virtual ~ISendTimelinePacket()
30 {}
Sadik Armagan7bbdf9d2019-10-24 10:26:05 +010031
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.
Colm Donelan5ccb33d2020-01-24 16:27:02 +000039 virtual void
Jim Flynn1fdeb992020-07-09 07:28:37 +010040 SendTimelineEventBinaryPacket(uint64_t timestamp, int threadId, uint64_t profilingGuid) = 0;
Sadik Armagan7bbdf9d2019-10-24 10:26:05 +010041
42 /// Create and write a TimelineEventClassBinaryPacket from the parameters to the buffer.
Jim Flynn1892d212020-05-26 21:10:49 +010043 virtual void SendTimelineEventClassBinaryPacket(uint64_t profilingGuid, uint64_t nameGuid) = 0;
Sadik Armagan7bbdf9d2019-10-24 10:26:05 +010044
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,
Finn Williams0a336dc2020-05-11 15:39:58 +010055 uint64_t tailGuid,
56 uint64_t attributeGuid) = 0;
Sadik Armagan7bbdf9d2019-10-24 10:26:05 +010057};
58
Cathal Corbett5aa9fd72022-02-25 15:33:28 +000059} // namespace pipe
Sadik Armagan7bbdf9d2019-10-24 10:26:05 +010060
Cathal Corbett5aa9fd72022-02-25 15:33:28 +000061} // namespace arm