blob: 0fc3055dfdd82c53d038ff3b6864f3b9ad19f112 [file] [log] [blame]
Ferran Balaguer73882172019-09-02 16:39:42 +01001//
2// Copyright © 2017 Arm Ltd. All rights reserved.
3// SPDX-License-Identifier: MIT
4//
5
6#pragma once
7
8#include "IBufferWrapper.hpp"
9#include "ISendCounterPacket.hpp"
10#include "CounterDirectory.hpp"
11
12namespace armnn
13{
14
15namespace profiling
16{
17
18class SendCounterPacket : public ISendCounterPacket
19{
20public:
Francis Murtagh3a161982019-09-04 15:25:02 +010021 using IndexValuePairsVector = std::vector<std::pair<uint16_t, uint32_t>>;
22
23 SendCounterPacket(IBufferWrapper& buffer) : m_Buffer(buffer), m_ReadyToRead(false) {};
Ferran Balaguer73882172019-09-02 16:39:42 +010024
25 void SendStreamMetaDataPacket() override;
26
27 void SendCounterDirectoryPacket(const Category& category, const std::vector<Counter>& counters) override;
28
Francis Murtagh3a161982019-09-04 15:25:02 +010029 void SendPeriodicCounterCapturePacket(uint64_t timestamp, const IndexValuePairsVector& values) override;
Ferran Balaguer73882172019-09-02 16:39:42 +010030
31 void SendPeriodicCounterSelectionPacket(uint32_t capturePeriod,
32 const std::vector<uint16_t>& selectedCounterIds) override;
33
34 void SetReadyToRead() override;
35
Ferran Balaguer47d0fe92019-09-04 16:47:34 +010036 static const unsigned int PIPE_MAGIC = 0x45495434;
37 static const unsigned int MAX_METADATA_PACKET_LENGTH = 4096;
38
Ferran Balaguer73882172019-09-02 16:39:42 +010039private:
40 IBufferWrapper& m_Buffer;
41 bool m_ReadyToRead;
42};
43
44} // namespace profiling
45
46} // namespace armnn
47