diff options
author | Keith Davis <keith.davis@arm.com> | 2020-03-05 16:25:28 +0000 |
---|---|---|
committer | Keith Davis Arm <keith.davis@arm.com> | 2020-03-09 16:11:25 +0000 |
commit | 97da5e2e6c8aaaf4249af60e8305431315226f15 (patch) | |
tree | c36f01055cbf0f9577bca95f64ca6de42c923a77 /src/profiling/test/SendTimelinePacketTests.cpp | |
parent | 53d092d34c1e9924151d8d3a228c04620c1baf5c (diff) | |
download | armnn-97da5e2e6c8aaaf4249af60e8305431315226f15.tar.gz |
IVGCVSW-4541 Modify Timeline Packet construction
* Changed TimelinePacket encoding so that there is only one header for
multiple timeline swtrace messages
* Refactored function names to have more suitable description
* Refactored CodeStyle to coincide with ArmNN coding standards
* Refactored profiling test names to be descriptive
* Refactored ErrorCode name to TimelineStatus
* Updated existing unit tests
Signed-off-by: Keith Davis <keith.davis@arm.com>
Change-Id: I83bd4bb9e7393617bca97eba96a6e1388916e5b0
Diffstat (limited to 'src/profiling/test/SendTimelinePacketTests.cpp')
-rw-r--r-- | src/profiling/test/SendTimelinePacketTests.cpp | 43 |
1 files changed, 14 insertions, 29 deletions
diff --git a/src/profiling/test/SendTimelinePacketTests.cpp b/src/profiling/test/SendTimelinePacketTests.cpp index af15c57117..2e64c75b90 100644 --- a/src/profiling/test/SendTimelinePacketTests.cpp +++ b/src/profiling/test/SendTimelinePacketTests.cpp @@ -134,7 +134,7 @@ BOOST_AUTO_TEST_CASE(SendTimelineMessageDirectoryPackageTest) BOOST_CHECK(swTraceMessage.m_ArgNames[2] == "eventGuid"); } -BOOST_AUTO_TEST_CASE(SendTimelineEntityPlusEventClassBinaryPacketTest) +BOOST_AUTO_TEST_CASE(SendTimelineEntityWithEventClassPacketTest) { MockBufferManager bufferManager(40); TimelinePacketWriterFactory timelinePacketWriterFactory(bufferManager); @@ -159,23 +159,26 @@ BOOST_AUTO_TEST_CASE(SendTimelineEntityPlusEventClassBinaryPacketTest) unsigned int offset = 0; // Reading TimelineEntityClassBinaryPacket - uint32_t entityBinaryPacketHeaderWord0 = ReadUint32(packetBuffer, offset); - uint32_t entityBinaryPacketFamily = (entityBinaryPacketHeaderWord0 >> 26) & 0x0000003F; - uint32_t entityBinaryPacketClass = (entityBinaryPacketHeaderWord0 >> 19) & 0x0000007F; - uint32_t entityBinaryPacketType = (entityBinaryPacketHeaderWord0 >> 16) & 0x00000007; + uint32_t entityBinaryPacketHeaderWord0 = ReadUint32(packetBuffer, offset); + uint32_t entityBinaryPacketFamily = (entityBinaryPacketHeaderWord0 >> 26) & 0x0000003F; + uint32_t entityBinaryPacketClass = (entityBinaryPacketHeaderWord0 >> 19) & 0x0000007F; + uint32_t entityBinaryPacketType = (entityBinaryPacketHeaderWord0 >> 16) & 0x00000007; uint32_t entityBinaryPacketStreamId = (entityBinaryPacketHeaderWord0 >> 0) & 0x00000007; - BOOST_CHECK(entityBinaryPacketFamily == 1); - BOOST_CHECK(entityBinaryPacketClass == 0); - BOOST_CHECK(entityBinaryPacketType == 1); + BOOST_CHECK(entityBinaryPacketFamily == 1); + BOOST_CHECK(entityBinaryPacketClass == 0); + BOOST_CHECK(entityBinaryPacketType == 1); BOOST_CHECK(entityBinaryPacketStreamId == 0); offset += uint32_t_size; - uint32_t entityBinaryPacketHeaderWord1 = ReadUint32(packetBuffer, offset); + + uint32_t entityBinaryPacketHeaderWord1 = ReadUint32(packetBuffer, offset); + uint32_t entityBinaryPacketSequenceNumbered = (entityBinaryPacketHeaderWord1 >> 24) & 0x00000001; uint32_t entityBinaryPacketDataLength = (entityBinaryPacketHeaderWord1 >> 0) & 0x00FFFFFF; + BOOST_CHECK(entityBinaryPacketSequenceNumbered == 0); - BOOST_CHECK(entityBinaryPacketDataLength == 12); + BOOST_CHECK(entityBinaryPacketDataLength == 24); // Check the decl_id offset += uint32_t_size; @@ -191,25 +194,7 @@ BOOST_AUTO_TEST_CASE(SendTimelineEntityPlusEventClassBinaryPacketTest) // Reading TimelineEventClassBinaryPacket offset += uint64_t_size; - uint32_t eventClassBinaryPacketHeaderWord0 = ReadUint32(packetBuffer, offset); - uint32_t eventClassBinaryPacketFamily = (eventClassBinaryPacketHeaderWord0 >> 26) & 0x0000003F; - uint32_t eventClassBinaryPacketClass = (eventClassBinaryPacketHeaderWord0 >> 19) & 0x0000007F; - uint32_t eventClassBinaryPacketType = (eventClassBinaryPacketHeaderWord0 >> 16) & 0x00000007; - uint32_t eventClassBinaryPacketStreamId = (eventClassBinaryPacketHeaderWord0 >> 0) & 0x00000007; - - BOOST_CHECK(eventClassBinaryPacketFamily == 1); - BOOST_CHECK(eventClassBinaryPacketClass == 0); - BOOST_CHECK(eventClassBinaryPacketType == 1); - BOOST_CHECK(eventClassBinaryPacketStreamId == 0); - offset += uint32_t_size; - uint32_t eventClassBinaryPacketHeaderWord1 = ReadUint32(packetBuffer, offset); - uint32_t eventClassBinaryPacketSequenceNumbered = (eventClassBinaryPacketHeaderWord1 >> 24) & 0x00000001; - uint32_t eventClassBinaryPacketDataLength = (eventClassBinaryPacketHeaderWord1 >> 0) & 0x00FFFFFF; - BOOST_CHECK(eventClassBinaryPacketSequenceNumbered == 0); - BOOST_CHECK(eventClassBinaryPacketDataLength == 12); - - offset += uint32_t_size; uint32_t eventClassDeclId = ReadUint32(packetBuffer, offset); BOOST_CHECK(eventClassDeclId == uint32_t(2)); @@ -221,7 +206,7 @@ BOOST_AUTO_TEST_CASE(SendTimelineEntityPlusEventClassBinaryPacketTest) bufferManager.MarkRead(packetBuffer); } -BOOST_AUTO_TEST_CASE(SendTimelinePacketTests1) +BOOST_AUTO_TEST_CASE(SendEventClassAfterTimelineEntityPacketTest) { unsigned int uint32_t_size = sizeof(uint32_t); unsigned int uint64_t_size = sizeof(uint64_t); |