12 #include <common/include/PacketVersionResolver.hpp> 13 #include <common/include/ProfilingException.hpp> 23 std::vector<uint32_t> headers;
24 headers.push_back(m_CounterDirectoryMessageHeader);
30 if (packet.GetHeader() != m_CounterDirectoryMessageHeader)
34 arm::pipe::PacketVersionResolver packetVersionResolver;
36 0, 2, packetVersionResolver.ResolvePacketVersion(0, 2).GetEncodedValue());
37 directoryCaptureCommandHandler.operator()(packet);
38 const ICounterDirectory& counterDirectory = directoryCaptureCommandHandler.GetCounterDirectory();
42 std::vector<uint16_t> translatedCounters;
43 for (
auto const& copyUid : category->m_Counters)
45 translatedCounters.emplace_back(directoryCaptureCommandHandler.TranslateUIDCopyToOriginal(copyUid));
47 m_IdList.insert(std::end(m_IdList), std::begin(translatedCounters), std::end(translatedCounters));
49 SendCounterSelectionPacket();
52 void RequestCountersPacketHandler::SendCounterSelectionPacket()
58 uint32_t bodySize = uint32_t_size +
armnn::numeric_cast<uint32_t>(m_IdList.size()) * uint16_t_size;
60 auto uniqueData = std::make_unique<unsigned char[]>(bodySize);
61 auto data =
reinterpret_cast<unsigned char*
>(uniqueData.get());
68 for (
const uint16_t&
id : m_IdList)
74 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) 2021 ARM Limited and Contributors.
virtual const Categories & GetCategories() const =0
virtual void ReturnPacket(arm::pipe::Packet &packet)=0
void HandlePacket(const arm::pipe::Packet &packet) override
process the packet
std::enable_if_t< std::is_unsigned< Source >::value &&std::is_unsigned< Dest >::value, Dest > numeric_cast(Source source)
std::vector< uint32_t > GetHeadersAccepted() override