diff options
author | Matteo Martincigh <matteo.martincigh@arm.com> | 2019-11-06 15:30:54 +0000 |
---|---|---|
committer | Matteo Martincigh <matteo.martincigh@arm.com> | 2019-11-15 15:12:45 +0000 |
commit | 34a407d4a95830ff9fad05e2bff34dcfc631c931 (patch) | |
tree | ff8673a7ea0ffa493885017400a3ea543fce96f9 /src/profiling/test/TimelinePacketTests.cpp | |
parent | 30db8ad8b15e5d0e94ae2ff64c246350885c4b6b (diff) | |
download | armnn-34a407d4a95830ff9fad05e2bff34dcfc631c931.tar.gz |
IVGCVSW-4072 Add stream header to Timeline Message Directory packet
* Refactored the WriteTimelineMessageDirectoryPacket function
* Added the stream header to the packet
* Updated decoders/parsers
* Updated unit tests accordingly
* Minor refactoring
Signed-off-by: Matteo Martincigh <matteo.martincigh@arm.com>
Change-Id: I58f15fde54adc6414ca9fd5fb8d6157cad867339
Diffstat (limited to 'src/profiling/test/TimelinePacketTests.cpp')
-rw-r--r-- | src/profiling/test/TimelinePacketTests.cpp | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/src/profiling/test/TimelinePacketTests.cpp b/src/profiling/test/TimelinePacketTests.cpp index 68cd948bdd..824f055a41 100644 --- a/src/profiling/test/TimelinePacketTests.cpp +++ b/src/profiling/test/TimelinePacketTests.cpp @@ -520,9 +520,12 @@ BOOST_AUTO_TEST_CASE(TimelineMessageDirectoryPacketTest3) numberOfBytesWritten); BOOST_CHECK(result == TimelinePacketStatus::Ok); - BOOST_CHECK(numberOfBytesWritten == 424); + BOOST_CHECK(numberOfBytesWritten == 427); + unsigned int uint8_t_size = sizeof(uint8_t); unsigned int uint32_t_size = sizeof(uint32_t); + unsigned int uint64_t_size = sizeof(uint64_t); + unsigned int threadId_size = sizeof(std::thread::id); // Check the packet header unsigned int offset = 0; @@ -541,10 +544,21 @@ BOOST_AUTO_TEST_CASE(TimelineMessageDirectoryPacketTest3) uint32_t sequenceNumbered = (packetHeaderWord1 >> 24) & 0x00000001; uint32_t dataLength = (packetHeaderWord1 >> 0) & 0x00FFFFFF; BOOST_CHECK(sequenceNumbered == 0); - BOOST_CHECK(dataLength == 416); + BOOST_CHECK(dataLength == 419); - // Check the number of declarations + // Check the stream header offset += uint32_t_size; + uint8_t readStreamVersion = ReadUint8(buffer.data(), offset); + BOOST_CHECK(readStreamVersion == 4); + offset += uint8_t_size; + uint8_t readPointerBytes = ReadUint8(buffer.data(), offset); + BOOST_CHECK(readPointerBytes == uint64_t_size); + offset += uint8_t_size; + uint8_t readThreadIdBytes = ReadUint8(buffer.data(), offset); + BOOST_CHECK(readThreadIdBytes == threadId_size); + + // Check the number of declarations + offset += uint8_t_size; uint32_t declCount = ReadUint32(buffer.data(), offset); BOOST_CHECK(declCount == 5); @@ -564,7 +578,7 @@ BOOST_AUTO_TEST_CASE(TimelineMessageDirectoryPacketTest3) std::string label = "declareLabel"; offset += uint32_t_size; BOOST_CHECK(std::memcmp(buffer.data() + offset, // Offset to the label in the buffer - label.data(), // The original label + label.data(), // The original label swTraceDeclNameLength - 1) == 0); // The length of the label // Check the ui_name |