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 | |
Jim Flynn | 3e9bc19 | 2022-03-23 23:01:26 +0000 | [diff] [blame] | 8 | #include <client/src/ProfilingUtils.hpp> |
Jim Flynn | 01d0281 | 2020-04-29 21:12:13 +0100 | [diff] [blame] | 9 | |
Jim Flynn | 2776183 | 2022-03-20 21:52:17 +0000 | [diff] [blame] | 10 | #include <client/include/ILocalPacketHandler.hpp> |
| 11 | #include <client/include/ProfilingOptions.hpp> |
| 12 | |
Jim Flynn | bbfe603 | 2020-07-20 16:57:44 +0100 | [diff] [blame] | 13 | #include <common/include/Packet.hpp> |
| 14 | |
Cathal Corbett | 5aa9fd7 | 2022-02-25 15:33:28 +0000 | [diff] [blame] | 15 | namespace arm |
Jim Flynn | 01d0281 | 2020-04-29 21:12:13 +0100 | [diff] [blame] | 16 | { |
| 17 | |
Cathal Corbett | 5aa9fd7 | 2022-02-25 15:33:28 +0000 | [diff] [blame] | 18 | namespace pipe |
Jim Flynn | 01d0281 | 2020-04-29 21:12:13 +0100 | [diff] [blame] | 19 | { |
| 20 | |
| 21 | class RequestCountersPacketHandler : public ILocalPacketHandler |
| 22 | { |
| 23 | public: |
Jim Flynn | 4c9ed1d | 2022-01-23 23:57:20 +0000 | [diff] [blame] | 24 | explicit RequestCountersPacketHandler(uint32_t capturePeriod = arm::pipe::LOWEST_CAPTURE_PERIOD) : |
Jim Flynn | 01d0281 | 2020-04-29 21:12:13 +0100 | [diff] [blame] | 25 | m_CapturePeriod(capturePeriod), |
| 26 | m_Connection(nullptr), |
| 27 | m_CounterDirectoryMessageHeader(ConstructHeader(0, 2)) {} |
| 28 | |
| 29 | std::vector<uint32_t> GetHeadersAccepted() override; // ILocalPacketHandler |
| 30 | |
Jim Flynn | bbfe603 | 2020-07-20 16:57:44 +0100 | [diff] [blame] | 31 | void HandlePacket(const arm::pipe::Packet& packet) override; // ILocalPacketHandler |
Jim Flynn | 01d0281 | 2020-04-29 21:12:13 +0100 | [diff] [blame] | 32 | |
| 33 | void SetConnection(IInternalProfilingConnection* profilingConnection) override // ILocalPacketHandler |
| 34 | { |
| 35 | m_Connection = profilingConnection; |
| 36 | } |
| 37 | |
| 38 | private: |
| 39 | uint32_t m_CapturePeriod; |
| 40 | IInternalProfilingConnection* m_Connection; |
| 41 | uint32_t m_CounterDirectoryMessageHeader; |
| 42 | std::vector<uint16_t> m_IdList; |
| 43 | |
| 44 | void SendCounterSelectionPacket(); |
| 45 | }; |
| 46 | |
Cathal Corbett | 5aa9fd7 | 2022-02-25 15:33:28 +0000 | [diff] [blame] | 47 | } // namespace pipe |
Jim Flynn | 01d0281 | 2020-04-29 21:12:13 +0100 | [diff] [blame] | 48 | |
Cathal Corbett | 5aa9fd7 | 2022-02-25 15:33:28 +0000 | [diff] [blame] | 49 | } // namespace arm |