Ferran Balaguer | af5c46b | 2019-08-30 15:49:15 +0100 | [diff] [blame] | 1 | // |
| 2 | // Copyright © 2017 Arm Ltd. All rights reserved. |
| 3 | // SPDX-License-Identifier: MIT |
| 4 | // |
| 5 | |
| 6 | #pragma once |
| 7 | |
Matteo Martincigh | 42f9d9e | 2019-09-05 12:02:04 +0100 | [diff] [blame] | 8 | #include "ICounterDirectory.hpp" |
Ferran Balaguer | af5c46b | 2019-08-30 15:49:15 +0100 | [diff] [blame] | 9 | |
| 10 | namespace armnn |
| 11 | { |
| 12 | |
| 13 | namespace profiling |
| 14 | { |
| 15 | |
| 16 | class ISendCounterPacket |
| 17 | { |
| 18 | public: |
Francis Murtagh | 3a16198 | 2019-09-04 15:25:02 +0100 | [diff] [blame] | 19 | using IndexValuePairsVector = std::vector<std::pair<uint16_t, uint32_t>>; |
| 20 | |
Matteo Martincigh | 2e7c885 | 2019-09-09 09:23:53 +0100 | [diff] [blame] | 21 | virtual ~ISendCounterPacket() {} |
| 22 | |
Ferran Balaguer | af5c46b | 2019-08-30 15:49:15 +0100 | [diff] [blame] | 23 | /// Create and write a StreamMetaDataPacket in the buffer |
| 24 | virtual void SendStreamMetaDataPacket() = 0; |
| 25 | |
| 26 | /// Create and write a CounterDirectoryPacket from the parameters to the buffer. |
Matteo Martincigh | 42f9d9e | 2019-09-05 12:02:04 +0100 | [diff] [blame] | 27 | virtual void SendCounterDirectoryPacket(const ICounterDirectory& counterDirectory) = 0; |
Ferran Balaguer | af5c46b | 2019-08-30 15:49:15 +0100 | [diff] [blame] | 28 | |
| 29 | /// Create and write a PeriodicCounterCapturePacket from the parameters to the buffer. |
Francis Murtagh | 3a16198 | 2019-09-04 15:25:02 +0100 | [diff] [blame] | 30 | virtual void SendPeriodicCounterCapturePacket(uint64_t timestamp, const IndexValuePairsVector& values) = 0; |
Ferran Balaguer | af5c46b | 2019-08-30 15:49:15 +0100 | [diff] [blame] | 31 | |
| 32 | /// Create and write a PeriodicCounterSelectionPacket from the parameters to the buffer. |
| 33 | virtual void SendPeriodicCounterSelectionPacket(uint32_t capturePeriod, |
| 34 | const std::vector<uint16_t>& selectedCounterIds) = 0; |
| 35 | |
| 36 | /// Set a "ready to read" flag in the buffer to notify the reading thread to start reading it. |
| 37 | virtual void SetReadyToRead() = 0; |
| 38 | |
| 39 | }; |
| 40 | |
| 41 | } // namespace profiling |
| 42 | |
| 43 | } // namespace armnn |
| 44 | |