blob: a95413455a18769b1d16e3840e57f497125841e4 [file] [log] [blame]
Sadik Armagan7bbdf9d2019-10-24 10:26:05 +01001//
2// Copyright © 2019 Arm Ltd. All rights reserved.
3// SPDX-License-Identifier: MIT
4//
5
6#pragma once
7
8#include "ProfilingUtils.hpp"
9
10#include <algorithm>
11#include <string>
12#include <vector>
Matteo Martincigh378bbfc2019-11-04 14:05:28 +000013#include <thread>
Sadik Armagan7bbdf9d2019-10-24 10:26:05 +010014
15namespace armnn
16{
17
18namespace profiling
19{
20
21class ISendTimelinePacket
22{
23public:
24 virtual ~ISendTimelinePacket() {}
25
26 /// Commits the current buffer and reset the member variables
27 virtual void Commit() = 0;
28
29 /// Create and write a TimelineEntityBinaryPacket from the parameters to the buffer.
30 virtual void SendTimelineEntityBinaryPacket(uint64_t profilingGuid) = 0;
31
32 /// Create and write a TimelineEventBinaryPacket from the parameters to the buffer.
Matteo Martincigh378bbfc2019-11-04 14:05:28 +000033 virtual void SendTimelineEventBinaryPacket(uint64_t timestamp,
34 std::thread::id threadId,
35 uint64_t profilingGuid) = 0;
Sadik Armagan7bbdf9d2019-10-24 10:26:05 +010036
37 /// Create and write a TimelineEventClassBinaryPacket from the parameters to the buffer.
38 virtual void SendTimelineEventClassBinaryPacket(uint64_t profilingGuid) = 0;
39
40 /// Create and write a TimelineLabelBinaryPacket from the parameters to the buffer.
41 virtual void SendTimelineLabelBinaryPacket(uint64_t profilingGuid, const std::string& label) = 0;
42
43 /// Create and write a TimelineMessageDirectoryPackage in the buffer
44 virtual void SendTimelineMessageDirectoryPackage() = 0;
45
46 /// Create and write a TimelineRelationshipBinaryPacket from the parameters to the buffer.
47 virtual void SendTimelineRelationshipBinaryPacket(ProfilingRelationshipType relationshipType,
48 uint64_t relationshipGuid,
49 uint64_t headGuid,
50 uint64_t tailGuid) = 0;
51};
52
53} // namespace profiling
54
55} // namespace armnn
56