1 // 2 // Copyright © 2020 Arm Ltd and Contributors. All rights reserved. 3 // SPDX-License-Identifier: MIT 4 // 5 6 #pragma once 7 8 #include <client/src/ProfilingUtils.hpp> 9 10 #include <client/include/ILocalPacketHandler.hpp> 11 #include <client/include/ProfilingOptions.hpp> 12 13 #include <common/include/Packet.hpp> 14 15 namespace arm 16 { 17 18 namespace pipe 19 { 20 21 class RequestCountersPacketHandler : public ILocalPacketHandler 22 { 23 public: RequestCountersPacketHandler(uint32_t capturePeriod=arm::pipe::LOWEST_CAPTURE_PERIOD)24 explicit RequestCountersPacketHandler(uint32_t capturePeriod = arm::pipe::LOWEST_CAPTURE_PERIOD) : 25 m_CapturePeriod(capturePeriod), 26 m_Connection(nullptr), 27 m_CounterDirectoryMessageHeader(ConstructHeader(0, 2)) {} 28 29 std::vector<uint32_t> GetHeadersAccepted() override; // ILocalPacketHandler 30 31 void HandlePacket(const arm::pipe::Packet& packet) override; // ILocalPacketHandler 32 SetConnection(IInternalProfilingConnection * profilingConnection)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 47 } // namespace pipe 48 49 } // namespace arm 50