diff options
author | Finn Williams <Finn.Williams@arm.com> | 2020-04-22 12:27:37 +0100 |
---|---|---|
committer | Finn Williams <Finn.Williams@arm.com> | 2020-04-22 14:14:42 +0100 |
commit | a0de05689870ecede28ca91ea0c8474daa7f8d6a (patch) | |
tree | 3fd1f3730bebd44240e5d848ff726aa123d0f564 /src/profiling/test/ProfilingTestUtils.cpp | |
parent | 6544f40295e93fbb8d25582bd3a94341537ec6ca (diff) | |
download | armnn-a0de05689870ecede28ca91ea0c8474daa7f8d6a.tar.gz |
IVGCVSW-4719 Remove possible zeros from SendStreamMetaDataPacket offsets
Signed-off-by: Finn Williams <Finn.Williams@arm.com>
Change-Id: I8d7ee408c4c73be9b42bb739254b95c476e0e38c
Diffstat (limited to 'src/profiling/test/ProfilingTestUtils.cpp')
-rw-r--r-- | src/profiling/test/ProfilingTestUtils.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/profiling/test/ProfilingTestUtils.cpp b/src/profiling/test/ProfilingTestUtils.cpp index 5c63b54b8f..c1386820e8 100644 --- a/src/profiling/test/ProfilingTestUtils.cpp +++ b/src/profiling/test/ProfilingTestUtils.cpp @@ -14,6 +14,26 @@ #include <boost/test/unit_test.hpp> +uint32_t GetStreamMetaDataPacketSize() +{ + uint32_t sizeUint32 = sizeof(uint32_t); + uint32_t payloadSize = 0; + payloadSize += boost::numeric_cast<uint32_t>(GetSoftwareInfo().size()) + 1; + payloadSize += boost::numeric_cast<uint32_t>(GetHardwareVersion().size()) + 1; + payloadSize += boost::numeric_cast<uint32_t>(GetSoftwareVersion().size()) + 1; + payloadSize += boost::numeric_cast<uint32_t>(GetProcessName().size()) + 1; + + // Add packetVersionEntries + payloadSize += 6 * 2 * sizeUint32; + // Add packetVersionCountSize + payloadSize += sizeUint32; + + uint32_t headerSize = 2 * sizeUint32; + uint32_t bodySize = 10 * sizeUint32; + + return headerSize + bodySize + payloadSize; +} + inline unsigned int OffsetToNextWord(unsigned int numberOfBytes) { unsigned int uint32_t_size = sizeof(uint32_t); |