7 #include <common/include/EncodeVersion.hpp> 14 #include <common/include/Constants.hpp> 15 #include <common/include/SwTrace.hpp> 17 #include <fmt/format.h> 35 const uint32_t hardwareVersionSize =
armnn::numeric_cast<uint32_t>(hardwareVersion.size()) + 1;
36 const uint32_t softwareVersionSize =
armnn::numeric_cast<uint32_t>(softwareVersion.size()) + 1;
39 const uint32_t sizeUint32 =
sizeof(uint32_t);
41 const uint32_t headerSize = 2 * sizeUint32;
42 const uint32_t bodySize = 10 * sizeUint32;
43 const uint32_t packetVersionCountSize = sizeUint32;
62 std::vector<std::pair<uint32_t, uint32_t>> packetVersions;
63 packetVersions.push_back(std::make_pair(
ConstructHeader(0, 0), arm::pipe::EncodeVersion(1, 0, 0)));
64 packetVersions.push_back(std::make_pair(
ConstructHeader(0, 1), arm::pipe::EncodeVersion(1, 0, 0)));
65 packetVersions.push_back(std::make_pair(
ConstructHeader(0, 2), arm::pipe::EncodeVersion(1, 0, 0)));
66 packetVersions.push_back(std::make_pair(
ConstructHeader(0, 3), arm::pipe::EncodeVersion(1, 0, 0)));
67 packetVersions.push_back(std::make_pair(
ConstructHeader(0, 4), arm::pipe::EncodeVersion(1, 0, 0)));
68 packetVersions.push_back(std::make_pair(
ConstructHeader(0, 5), arm::pipe::EncodeVersion(1, 0, 0)));
69 packetVersions.push_back(std::make_pair(
ConstructHeader(0, 6), arm::pipe::EncodeVersion(1, 0, 0)));
70 packetVersions.push_back(std::make_pair(
ConstructHeader(0, 7), arm::pipe::EncodeVersion(1, 0, 0)));
71 packetVersions.push_back(std::make_pair(
ConstructHeader(3, 0, 0), arm::pipe::EncodeVersion(1, 0, 0)));
72 packetVersions.push_back(std::make_pair(
ConstructHeader(3, 1, 0), arm::pipe::EncodeVersion(1, 0, 0)));
73 packetVersions.push_back(std::make_pair(
ConstructHeader(3, 1, 1), arm::pipe::EncodeVersion(1, 0, 0)));
74 packetVersions.push_back(std::make_pair(
ConstructHeader(1, 0, 0), arm::pipe::EncodeVersion(1, 0, 0)));
75 packetVersions.push_back(std::make_pair(
ConstructHeader(1, 0, 1), arm::pipe::EncodeVersion(1, 0, 0)));
77 uint32_t packetVersionSize =
armnn::numeric_cast<uint32_t>(numberOfVersions * 2 * sizeUint32);
80 softwareVersionSize + processNameSize +
81 packetVersionCountSize + packetVersionSize);
83 const uint32_t totalSize = headerSize + bodySize + payloadSize;
85 uint32_t reserved = 0;
89 if (writeBuffer ==
nullptr || reserved < totalSize)
91 CancelOperationAndThrow<BufferExhaustion>(
93 fmt::format(
"No space left in buffer. Unable to reserve ({}) bytes.", totalSize));
101 offset += sizeUint32;
102 WriteUint32(writeBuffer, offset, totalSize - headerSize);
106 offset += sizeUint32;
107 WriteUint32(writeBuffer, offset, arm::pipe::PIPE_MAGIC);
108 offset += sizeUint32;
109 WriteUint32(writeBuffer, offset, arm::pipe::EncodeVersion(1, 0, 0));
110 offset += sizeUint32;
112 offset += sizeUint32;
114 WriteUint32(writeBuffer, offset, armnn::numeric_cast<uint32_t>(pid));
115 offset += sizeUint32;
116 uint32_t poolOffset = bodySize;
118 offset += sizeUint32;
119 poolOffset += infoSize;
121 offset += sizeUint32;
122 poolOffset += hardwareVersionSize;
124 offset += sizeUint32;
125 poolOffset += softwareVersionSize;
127 offset += sizeUint32;
128 poolOffset += processNameSize;
130 offset += sizeUint32;
132 offset += sizeUint32;
138 memcpy(&writeBuffer->GetWritableData()[offset], info.c_str(), infoSize);
142 memcpy(&writeBuffer->GetWritableData()[offset], hardwareVersion.c_str(), hardwareVersionSize);
143 offset += hardwareVersionSize;
144 memcpy(&writeBuffer->GetWritableData()[offset], softwareVersion.c_str(), softwareVersionSize);
145 offset += softwareVersionSize;
146 memcpy(&writeBuffer->GetWritableData()[offset], processName.c_str(), processNameSize);
147 offset += processNameSize;
149 if (!packetVersions.empty())
152 WriteUint32(writeBuffer, offset, numberOfVersions << 16);
153 offset += sizeUint32;
156 for (std::pair<uint32_t, uint32_t>& packetVersion : packetVersions)
158 WriteUint32(writeBuffer, offset, packetVersion.first);
159 offset += sizeUint32;
160 WriteUint32(writeBuffer, offset, packetVersion.second);
161 offset += sizeUint32;
167 CancelOperationAndThrow<RuntimeException>(writeBuffer,
"Error processing packet.");
170 m_BufferManager.
Commit(writeBuffer, totalSize,
false);
176 std::string& errorMessage)
180 const std::string& categoryName = category->m_Name;
184 std::vector<uint16_t> categoryCounters;
185 for (
size_t counterIndex = 0; counterIndex < category->m_Counters.size(); ++counterIndex)
187 uint16_t counterUid = category->m_Counters.at(counterIndex);
188 auto it = counters.find(counterUid);
189 if (it == counters.end())
191 errorMessage = fmt::format(
"Counter ({}) not found in category ({})",
199 if (counterUid == counter->m_MaxCounterUid)
201 categoryCounters.emplace_back(counterUid);
204 if (categoryCounters.empty())
206 errorMessage = fmt::format(
"No valid counters found in category ({})", categoryName);
214 std::vector<uint32_t> categoryNameBuffer;
215 if (!arm::pipe::StringToSwTraceString<arm::pipe::SwTraceNameCharPolicy>(categoryName, categoryNameBuffer))
217 errorMessage = fmt::format(
"Cannot convert the name of category ({}) to an SWTrace namestring",
225 const uint32_t categoryRecordWord1 =
static_cast<uint32_t
>(categoryCounters.size()) << 16;
230 const uint32_t categoryRecordWord2 =
static_cast<uint32_t
>(3u *
uint32_t_size);
233 const size_t counterCount = categoryCounters.size();
234 std::vector<EventRecord> eventRecords(counterCount);
235 std::vector<uint32_t> eventRecordOffsets(counterCount, 0);
236 size_t eventRecordsSize = 0;
238 (eventRecords.size() + categoryNameBuffer.size()) * uint32_t_size);
239 for (
size_t counterIndex = 0, eventRecordIndex = 0, eventRecordOffsetIndex = 0;
240 counterIndex < counterCount;
241 counterIndex++, eventRecordIndex++, eventRecordOffsetIndex++)
243 uint16_t counterUid = categoryCounters.at(counterIndex);
244 auto it = counters.find(counterUid);
247 EventRecord& eventRecord = eventRecords.at(eventRecordIndex);
254 eventRecordsSize += eventRecord.size();
257 eventRecordOffsets[eventRecordOffsetIndex] = eventRecordsOffset;
264 (3u + eventRecordOffsets.size()) * uint32_t_size);
267 const size_t categoryRecordSize = 3u +
269 eventRecordOffsets.size() +
270 categoryNameBuffer.size() +
274 categoryRecord.resize(categoryRecordSize);
278 categoryRecord[0] = categoryRecordWord1;
279 categoryRecord[1] = categoryRecordWord2;
280 categoryRecord[2] = categoryRecordWord3;
281 auto offset = categoryRecord.begin() + 3u;
282 std::copy(eventRecordOffsets.begin(), eventRecordOffsets.end(), offset);
283 offset += eventRecordOffsets.size();
284 std::copy(categoryNameBuffer.begin(), categoryNameBuffer.end(), offset);
285 offset += categoryNameBuffer.size();
286 for (
const EventRecord& eventRecord : eventRecords)
288 std::copy(eventRecord.begin(), eventRecord.end(), offset);
289 offset += eventRecord.size();
298 std::string& errorMessage)
302 uint16_t deviceUid = device->m_Uid;
303 const std::string& deviceName = device->m_Name;
304 uint16_t deviceCores = device->m_Cores;
311 const uint32_t deviceRecordWord0 = (
static_cast<uint32_t
>(deviceUid) << 16) |
312 (
static_cast<uint32_t
>(deviceCores));
316 const uint32_t deviceRecordWord1 = 8u;
320 std::vector<uint32_t> deviceNameBuffer;
321 if (!arm::pipe::StringToSwTraceString<arm::pipe::SwTraceCharPolicy>(deviceName, deviceNameBuffer))
323 errorMessage = fmt::format(
"Cannot convert the name of device {} ({}) to an SWTrace string",
330 const size_t deviceRecordSize = 2u +
331 deviceNameBuffer.size();
335 deviceRecord.resize(deviceRecordSize);
338 deviceRecord[0] = deviceRecordWord0;
339 deviceRecord[1] = deviceRecordWord1;
340 auto offset = deviceRecord.begin() + 2u;
341 std::copy(deviceNameBuffer.begin(), deviceNameBuffer.end(), offset);
348 std::string& errorMessage)
352 uint16_t counterSetUid = counterSet->m_Uid;
353 const std::string& counterSetName = counterSet->m_Name;
354 uint16_t counterSetCount = counterSet->m_Count;
361 const uint32_t counterSetRecordWord0 = (
static_cast<uint32_t
>(counterSetUid) << 16) |
362 (
static_cast<uint32_t
>(counterSetCount));
366 const uint32_t counterSetRecordWord1 = 8u;
370 std::vector<uint32_t> counterSetNameBuffer;
371 if (!arm::pipe::StringToSwTraceString<arm::pipe::SwTraceNameCharPolicy>(counterSet->m_Name, counterSetNameBuffer))
373 errorMessage = fmt::format(
"Cannot convert the name of counter set {} ({}) to an SWTrace namestring",
380 const size_t counterSetRecordSize = 2u +
381 counterSetNameBuffer.size();
385 counterSetRecord.resize(counterSetRecordSize);
388 counterSetRecord[0] = counterSetRecordWord0;
389 counterSetRecord[1] = counterSetRecordWord1;
390 auto offset = counterSetRecord.begin() + 2u;
391 std::copy(counterSetNameBuffer.begin(), counterSetNameBuffer.end(), offset);
398 std::string& errorMessage)
402 uint16_t counterUid = counter->m_Uid;
403 uint16_t maxCounterUid = counter->m_MaxCounterUid;
404 uint16_t deviceUid = counter->m_DeviceUid;
405 uint16_t counterSetUid = counter->m_CounterSetUid;
406 uint16_t counterClass = counter->m_Class;
407 uint16_t counterInterpolation = counter->m_Interpolation;
408 double counterMultiplier = counter->m_Multiplier;
409 const std::string& counterName = counter->m_Name;
410 const std::string& counterDescription = counter->m_Description;
411 const std::string& counterUnits = counter->m_Units;
414 ARMNN_ASSERT(counterInterpolation == 0 || counterInterpolation == 1);
424 const size_t eventRecordBlockSize = 8u;
433 const uint32_t eventRecordWord0 = (
static_cast<uint32_t
>(maxCounterUid) << 16) |
434 (
static_cast<uint32_t
>(counterUid));
441 const uint32_t eventRecordWord1 = (
static_cast<uint32_t
>(deviceUid) << 16) |
442 (
static_cast<uint32_t
>(counterSetUid));
447 const uint32_t eventRecordWord2 = (
static_cast<uint32_t
>(counterClass) << 16) |
448 (
static_cast<uint32_t
>(counterInterpolation));
453 uint32_t multiplier[2] = { 0u, 0u };
454 ARMNN_ASSERT(
sizeof(counterMultiplier) ==
sizeof(multiplier));
455 std::memcpy(multiplier, &counterMultiplier,
sizeof(multiplier));
456 const uint32_t eventRecordWord3 = multiplier[0];
457 const uint32_t eventRecordWord4 = multiplier[1];
461 const uint32_t eventRecordWord5 =
static_cast<uint32_t
>(eventRecordBlockSize *
uint32_t_size);
464 std::vector<uint32_t> counterNameBuffer;
465 if (!arm::pipe::StringToSwTraceString<arm::pipe::SwTraceCharPolicy>(counterName, counterNameBuffer))
467 errorMessage = fmt::format(
"Cannot convert the name of counter {} (name: {}) to an SWTrace string",
476 uint32_t eventRecordWord6 =
477 static_cast<uint32_t
>((counterNameBuffer.size() + eventRecordBlockSize) * uint32_t_size);
480 std::vector<uint32_t> counterDescriptionBuffer;
481 if (!arm::pipe::StringToSwTraceString<arm::pipe::SwTraceCharPolicy>(counterDescription, counterDescriptionBuffer))
483 errorMessage = fmt::format(
"Cannot convert the description of counter {} (description: {}) " 484 "to an SWTrace string",
493 bool includeUnits = !counterUnits.empty();
495 const uint32_t eventRecordWord7 = includeUnits ?
502 std::vector<uint32_t> counterUnitsBuffer;
506 if (!arm::pipe::StringToSwTraceString<arm::pipe::SwTraceNameCharPolicy>(counterUnits, counterUnitsBuffer))
508 errorMessage = fmt::format(
"Cannot convert the units of counter {} (units: {}) to an SWTrace string",
516 const size_t eventRecordSize = eventRecordBlockSize +
517 counterNameBuffer.size() +
518 counterDescriptionBuffer.size() +
519 counterUnitsBuffer.size();
522 eventRecord.resize(eventRecordSize);
526 eventRecord[0] = eventRecordWord0;
527 eventRecord[1] = eventRecordWord1;
528 eventRecord[2] = eventRecordWord2;
529 eventRecord[3] = eventRecordWord3;
530 eventRecord[4] = eventRecordWord4;
531 eventRecord[5] = eventRecordWord5;
532 eventRecord[6] = eventRecordWord6;
533 eventRecord[7] = eventRecordWord7;
534 auto offset = eventRecord.begin() + 8u;
535 std::copy(counterNameBuffer.begin(), counterNameBuffer.end(), offset);
536 offset += counterNameBuffer.size();
537 std::copy(counterDescriptionBuffer.begin(), counterDescriptionBuffer.end(), offset);
540 offset += counterDescriptionBuffer.size();
541 std::copy(counterUnitsBuffer.begin(), counterUnitsBuffer.end(), offset);
557 const size_t packetHeaderSize = 2u;
558 const size_t bodyHeaderSize = 6u;
559 const uint32_t bodyHeaderSizeBytes = bodyHeaderSize *
uint32_t_size;
562 uint32_t pointerTableOffset = 0;
569 std::vector<DeviceRecord> deviceRecords(deviceCount);
571 std::vector<uint32_t> deviceRecordOffsets(deviceCount, 0);
572 size_t deviceRecordsSize = 0;
573 size_t deviceIndex = 0;
574 size_t deviceRecordOffsetIndex = 0;
577 counterSetCount * uint32_t_size +
579 for (
auto it = devices.begin(); it != devices.end(); it++)
582 DeviceRecord& deviceRecord = deviceRecords.at(deviceIndex);
584 std::string errorMessage;
587 CancelOperationAndThrow<RuntimeException>(errorMessage);
591 deviceRecordsSize += deviceRecord.size();
594 deviceRecordOffsets[deviceRecordOffsetIndex] = pointerTableOffset;
598 deviceRecordOffsetIndex++;
606 std::vector<CounterSetRecord> counterSetRecords(counterSetCount);
608 std::vector<uint32_t> counterSetRecordOffsets(counterSetCount, 0);
609 size_t counterSetRecordsSize = 0;
610 size_t counterSetIndex = 0;
611 size_t counterSetRecordOffsetIndex = 0;
614 for (
auto it = counterSets.begin(); it != counterSets.end(); it++)
619 std::string errorMessage;
622 CancelOperationAndThrow<RuntimeException>(errorMessage);
626 counterSetRecordsSize += counterSetRecord.size();
629 counterSetRecordOffsets[counterSetRecordOffsetIndex] = pointerTableOffset;
633 counterSetRecordOffsetIndex++;
641 std::vector<CategoryRecord> categoryRecords(categoryCount);
643 std::vector<uint32_t> categoryRecordOffsets(categoryCount, 0);
644 size_t categoryRecordsSize = 0;
645 size_t categoryIndex = 0;
646 size_t categoryRecordOffsetIndex = 0;
649 for (
auto it = categories.begin(); it != categories.end(); it++)
652 CategoryRecord& categoryRecord = categoryRecords.at(categoryIndex);
654 std::string errorMessage;
657 CancelOperationAndThrow<RuntimeException>(errorMessage);
661 categoryRecordsSize += categoryRecord.size();
664 categoryRecordOffsets[categoryRecordOffsetIndex] = pointerTableOffset;
668 categoryRecordOffsetIndex++;
672 const size_t counterDirectoryPacketDataLength =
674 deviceRecordOffsets.size() +
675 counterSetRecordOffsets.size() +
676 categoryRecordOffsets.size() +
678 counterSetRecordsSize +
682 const size_t counterDirectoryPacketSize = packetHeaderSize +
683 counterDirectoryPacketDataLength;
686 std::vector<uint32_t> counterDirectoryPacket(counterDirectoryPacketSize, 0);
697 uint32_t packetFamily = 0;
698 uint32_t packetId = 2;
699 uint32_t packetHeaderWord0 = ((packetFamily & 0x3F) << 26) | ((packetId & 0x3FF) << 16);
707 uint32_t packetHeader[2]
720 const uint32_t bodyHeaderWord0 =
static_cast<uint32_t
>(deviceCount) << 16;
724 const uint32_t bodyHeaderWord1 = bodyHeaderSizeBytes;
731 const uint32_t bodyHeaderWord2 =
static_cast<uint32_t
>(counterSetCount) << 16;
735 const uint32_t bodyHeaderWord3 =
armnn::numeric_cast<uint32_t>(deviceRecordOffsets.size() *
737 bodyHeaderSizeBytes);
742 const uint32_t bodyHeaderWord4 =
static_cast<uint32_t
>(categoryCount) << 16;
746 const uint32_t bodyHeaderWord5 =
748 deviceRecordOffsets.size() * uint32_t_size +
749 counterSetRecordOffsets.size() * uint32_t_size
750 + bodyHeaderSizeBytes);
753 const uint32_t bodyHeader[bodyHeaderSize]
765 auto counterDirectoryPacketOffset = counterDirectoryPacket.begin();
767 std::copy(packetHeader, packetHeader + packetHeaderSize, counterDirectoryPacketOffset);
768 counterDirectoryPacketOffset += packetHeaderSize;
770 std::copy(bodyHeader, bodyHeader + bodyHeaderSize, counterDirectoryPacketOffset);
771 counterDirectoryPacketOffset += bodyHeaderSize;
773 std::copy(deviceRecordOffsets.begin(), deviceRecordOffsets.end(), counterDirectoryPacketOffset);
774 counterDirectoryPacketOffset += deviceRecordOffsets.size();
776 std::copy(counterSetRecordOffsets.begin(), counterSetRecordOffsets.end(), counterDirectoryPacketOffset);
777 counterDirectoryPacketOffset += counterSetRecordOffsets.size();
779 std::copy(categoryRecordOffsets.begin(), categoryRecordOffsets.end(), counterDirectoryPacketOffset);
780 counterDirectoryPacketOffset += categoryRecordOffsets.size();
784 std::copy(deviceRecord.begin(), deviceRecord.end(), counterDirectoryPacketOffset);
785 counterDirectoryPacketOffset += deviceRecord.size();
790 std::copy(counterSetRecord.begin(), counterSetRecord.end(), counterDirectoryPacketOffset);
791 counterDirectoryPacketOffset += counterSetRecord.size();
796 std::copy(categoryRecord.begin(), categoryRecord.end(), counterDirectoryPacketOffset);
797 counterDirectoryPacketOffset += categoryRecord.size();
805 uint32_t reserved = 0;
808 if (writeBuffer ==
nullptr || reserved < totalSize)
810 CancelOperationAndThrow<BufferExhaustion>(
812 fmt::format(
"No space left in buffer. Unable to reserve ({}) bytes.", totalSize));
819 for (uint32_t counterDirectoryPacketWord : counterDirectoryPacket)
821 WriteUint32(writeBuffer, offset, counterDirectoryPacketWord);
825 m_BufferManager.
Commit(writeBuffer, totalSize);
832 uint32_t uint64_t_size =
sizeof(uint64_t);
834 uint32_t packetFamily = 3;
835 uint32_t packetClass = 0;
836 uint32_t packetType = 0;
838 uint32_t bodySize = uint64_t_size +
armnn::numeric_cast<uint32_t>(values.size()) * (uint16_t_size + uint32_t_size);
839 uint32_t totalSize = headerSize + bodySize;
841 uint32_t reserved = 0;
845 if (writeBuffer ==
nullptr || reserved < totalSize)
847 CancelOperationAndThrow<BufferExhaustion>(
849 fmt::format(
"No space left in buffer. Unable to reserve ({}) bytes.", totalSize));
855 ((packetFamily & 0x0000003F) << 26) |
856 ((packetClass & 0x0000007F) << 19) |
857 ((packetType & 0x00000007) << 16));
866 offset += uint64_t_size;
867 for (
const auto& pair: values)
871 WriteUint32(writeBuffer, offset, pair.counterValue);
875 m_BufferManager.
Commit(writeBuffer, totalSize);
879 const std::vector<uint16_t>& selectedCounterIds)
884 uint32_t packetFamily = 0;
885 uint32_t packetId = 4;
887 uint32_t bodySize = uint32_t_size +
armnn::numeric_cast<uint32_t>(selectedCounterIds.size()) * uint16_t_size;
888 uint32_t totalSize = headerSize + bodySize;
890 uint32_t reserved = 0;
894 if (writeBuffer ==
nullptr || reserved < totalSize)
896 CancelOperationAndThrow<BufferExhaustion>(
898 fmt::format(
"No space left in buffer. Unable to reserve ({}) bytes.", totalSize));
902 WriteUint32(writeBuffer, offset, ((packetFamily & 0x3F) << 26) | ((packetId & 0x3FF) << 16));
912 for(
const uint16_t&
id: selectedCounterIds)
918 m_BufferManager.
Commit(writeBuffer, totalSize);
virtual IPacketBufferPtr Reserve(unsigned int requestedSize, unsigned int &reservedSize)=0
std::vector< uint32_t > CounterSetRecord
std::vector< CounterValue > IndexValuePairsVector
std::vector< uint32_t > DeviceRecord
std::string GetHardwareVersion()
void WriteUint16(const IPacketBufferPtr &packetBuffer, unsigned int offset, uint16_t value)
void WriteUint32(const IPacketBufferPtr &packetBuffer, unsigned int offset, uint32_t value)
bool CreateDeviceRecord(const DevicePtr &device, DeviceRecord &deviceRecord, std::string &errorMessage)
void SendCounterDirectoryPacket(const ICounterDirectory &counterDirectory) override
Create and write a CounterDirectoryPacket from the parameters to the buffer.
std::unordered_map< uint16_t, CounterPtr > Counters
#define ARMNN_NO_CONVERSION_WARN_END
std::unique_ptr< Device > DevicePtr
std::string GetProcessName()
void SendStreamMetaDataPacket() override
Create and write a StreamMetaDataPacket in the buffer.
std::unique_ptr< CounterSet > CounterSetPtr
virtual void Commit(IPacketBufferPtr &packetBuffer, unsigned int size, bool notifyConsumer=true)=0
Copyright (c) 2021 ARM Limited and Contributors.
virtual const CounterSets & GetCounterSets() const =0
std::string GetSoftwareInfo()
virtual uint16_t GetCategoryCount() const =0
std::unordered_map< uint16_t, CounterSetPtr > CounterSets
virtual const Categories & GetCategories() const =0
std::vector< uint32_t > EventRecord
virtual const Devices & GetDevices() const =0
std::shared_ptr< Counter > CounterPtr
void SendPeriodicCounterCapturePacket(uint64_t timestamp, const IndexValuePairsVector &values) override
Create and write a PeriodicCounterCapturePacket from the parameters to the buffer.
bool CreateCounterSetRecord(const CounterSetPtr &counterSet, CounterSetRecord &counterSetRecord, std::string &errorMessage)
virtual uint16_t GetDeviceCount() const =0
uint32_t ConstructHeader(uint32_t packetFamily, uint32_t packetId)
#define ARMNN_ASSERT(COND)
#define MAX_METADATA_PACKET_LENGTH
void WriteUint64(const std::unique_ptr< IPacketBuffer > &packetBuffer, unsigned int offset, uint64_t value)
std::unordered_set< CategoryPtr > Categories
virtual uint16_t GetCounterSetCount() const =0
#define ARMNN_NO_CONVERSION_WARN_BEGIN
std::string GetSoftwareVersion()
void SendPeriodicCounterSelectionPacket(uint32_t capturePeriod, const std::vector< uint16_t > &selectedCounterIds) override
Create and write a PeriodicCounterSelectionPacket from the parameters to the buffer.
std::vector< uint32_t > CategoryRecord
std::unique_ptr< Category > CategoryPtr
std::enable_if_t< std::is_unsigned< Source >::value &&std::is_unsigned< Dest >::value, Dest > numeric_cast(Source source)
virtual const Counters & GetCounters() const =0
std::unordered_map< uint16_t, DevicePtr > Devices
bool CreateEventRecord(const CounterPtr &counter, EventRecord &eventRecord, std::string &errorMessage)
std::unique_ptr< IPacketBuffer > IPacketBufferPtr
bool CreateCategoryRecord(const CategoryPtr &category, const Counters &counters, CategoryRecord &categoryRecord, std::string &errorMessage)