9 #include <common/include/PacketVersionResolver.hpp> 11 #include <common/include/ProfilingException.hpp> 21 std::vector<uint32_t> headers;
22 headers.push_back(m_CounterDirectoryMessageHeader);
28 if (packet.GetHeader() != m_CounterDirectoryMessageHeader)
32 arm::pipe::PacketVersionResolver packetVersionResolver;
34 0, 2, packetVersionResolver.ResolvePacketVersion(0, 2).GetEncodedValue());
35 directoryCaptureCommandHandler.operator()(packet);
36 const ICounterDirectory& counterDirectory = directoryCaptureCommandHandler.GetCounterDirectory();
40 std::vector<uint16_t> translatedCounters;
41 for (
auto const& copyUid : category->m_Counters)
43 translatedCounters.emplace_back(directoryCaptureCommandHandler.TranslateUIDCopyToOriginal(copyUid));
45 m_IdList.insert(std::end(m_IdList), std::begin(translatedCounters), std::end(translatedCounters));
47 SendCounterSelectionPacket();
50 void RequestCountersPacketHandler::SendCounterSelectionPacket()
56 uint32_t bodySize = uint32_t_size +
boost::numeric_cast<uint32_t>(m_IdList.size()) * uint16_t_size;
58 auto uniqueData = std::make_unique<unsigned char[]>(bodySize);
59 auto data =
reinterpret_cast<unsigned char*
>(uniqueData.get());
66 for (
const uint16_t&
id : m_IdList)
72 arm::pipe::Packet packet(0x40000, bodySize, uniqueData);
void WriteUint16(const IPacketBufferPtr &packetBuffer, unsigned int offset, uint16_t value)
void WriteUint32(const IPacketBufferPtr &packetBuffer, unsigned int offset, uint32_t value)
Copyright (c) 2020 ARM Limited.
virtual const Categories & GetCategories() const =0
virtual void ReturnPacket(arm::pipe::Packet &packet)=0
std::enable_if_t< std::is_unsigned< Source >::value &&std::is_unsigned< Dest >::value, Dest > numeric_cast(Source source)
void HandlePacket(const arm::pipe::Packet &packet) override
process the packet
std::vector< uint32_t > GetHeadersAccepted() override