MCPcopy Create free account
hub / github.com/ARM-software/armnn / CalculateSizeOfPaddedSwString

Function CalculateSizeOfPaddedSwString

profiling/common/src/SwTrace.cpp:22–29  ·  view source on GitHub ↗

Calculate the actual length an SwString will be including the terminating null character padding to bring it to the next uint32_t boundary but minus the leading uint32_t encoding the size to allow the offset to be correctly updated when decoding a binary packet.

Source from the content-addressed store, hash-verified

20// padding to bring it to the next uint32_t boundary but minus the leading uint32_t encoding
21// the size to allow the offset to be correctly updated when decoding a binary packet.
22uint32_t CalculateSizeOfPaddedSwString(const std::string& str)
23{
24 std::vector<uint32_t> swTraceString;
25 StringToSwTraceString<SwTraceCharPolicy>(str, swTraceString);
26 unsigned int uint32_t_size = sizeof(uint32_t);
27 uint32_t size = (numeric_cast<uint32_t>(swTraceString.size()) - 1) * uint32_t_size;
28 return size;
29}
30
31// Read TimelineMessageDirectoryPacket from given IPacketBuffer and offset
32SwTraceMessage ReadSwTraceMessage(const unsigned char* packetBuffer,

Callers 1

ReadSwTraceMessageFunction · 0.85

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected