Jim Flynn | 01d0281 | 2020-04-29 21:12:13 +0100 | [diff] [blame] | 1 | // |
Jim Flynn | bbfe603 | 2020-07-20 16:57:44 +0100 | [diff] [blame] | 2 | // Copyright © 2020 Arm Ltd and Contributors. All rights reserved. |
Jim Flynn | 01d0281 | 2020-04-29 21:12:13 +0100 | [diff] [blame] | 3 | // SPDX-License-Identifier: MIT |
| 4 | // |
| 5 | |
| 6 | #pragma once |
| 7 | |
| 8 | #include <armnn/Types.hpp> |
| 9 | #include <armnn/profiling/ILocalPacketHandler.hpp> |
Jim Flynn | 01d0281 | 2020-04-29 21:12:13 +0100 | [diff] [blame] | 10 | #include "ProfilingUtils.hpp" |
| 11 | |
Jim Flynn | bbfe603 | 2020-07-20 16:57:44 +0100 | [diff] [blame] | 12 | #include <common/include/Packet.hpp> |
| 13 | |
Jim Flynn | 01d0281 | 2020-04-29 21:12:13 +0100 | [diff] [blame] | 14 | namespace armnn |
| 15 | { |
| 16 | |
| 17 | namespace profiling |
| 18 | { |
| 19 | |
| 20 | class RequestCountersPacketHandler : public ILocalPacketHandler |
| 21 | { |
| 22 | public: |
| 23 | explicit RequestCountersPacketHandler(uint32_t capturePeriod = LOWEST_CAPTURE_PERIOD) : |
| 24 | m_CapturePeriod(capturePeriod), |
| 25 | m_Connection(nullptr), |
| 26 | m_CounterDirectoryMessageHeader(ConstructHeader(0, 2)) {} |
| 27 | |
| 28 | std::vector<uint32_t> GetHeadersAccepted() override; // ILocalPacketHandler |
| 29 | |
Jim Flynn | bbfe603 | 2020-07-20 16:57:44 +0100 | [diff] [blame] | 30 | void HandlePacket(const arm::pipe::Packet& packet) override; // ILocalPacketHandler |
Jim Flynn | 01d0281 | 2020-04-29 21:12:13 +0100 | [diff] [blame] | 31 | |
| 32 | void SetConnection(IInternalProfilingConnection* profilingConnection) override // ILocalPacketHandler |
| 33 | { |
| 34 | m_Connection = profilingConnection; |
| 35 | } |
| 36 | |
| 37 | private: |
| 38 | uint32_t m_CapturePeriod; |
| 39 | IInternalProfilingConnection* m_Connection; |
| 40 | uint32_t m_CounterDirectoryMessageHeader; |
| 41 | std::vector<uint16_t> m_IdList; |
| 42 | |
| 43 | void SendCounterSelectionPacket(); |
| 44 | }; |
| 45 | |
| 46 | } // namespace profiling |
| 47 | |
| 48 | } // namespace armnn |