Sadik Armagan | 7bbdf9d | 2019-10-24 10:26:05 +0100 | [diff] [blame] | 1 | // |
| 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 Martincigh | 378bbfc | 2019-11-04 14:05:28 +0000 | [diff] [blame] | 13 | #include <thread> |
Sadik Armagan | 7bbdf9d | 2019-10-24 10:26:05 +0100 | [diff] [blame] | 14 | |
| 15 | namespace armnn |
| 16 | { |
| 17 | |
| 18 | namespace profiling |
| 19 | { |
| 20 | |
| 21 | class ISendTimelinePacket |
| 22 | { |
| 23 | public: |
| 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 Martincigh | 378bbfc | 2019-11-04 14:05:28 +0000 | [diff] [blame] | 33 | virtual void SendTimelineEventBinaryPacket(uint64_t timestamp, |
| 34 | std::thread::id threadId, |
| 35 | uint64_t profilingGuid) = 0; |
Sadik Armagan | 7bbdf9d | 2019-10-24 10:26:05 +0100 | [diff] [blame] | 36 | |
| 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 | |