From 6be1e9be49a9166392dbd77bf2effdd7c28d7ef1 Mon Sep 17 00:00:00 2001 From: Finn Williams Date: Fri, 15 May 2020 11:21:54 +0100 Subject: IVGCVSW-4835 Change CounterSet and Device name offsets sizes to bytes Signed-off-by: Finn Williams Change-Id: I5dee006d5532cc85b86997a4cd0877afbf043122 --- src/profiling/SendCounterPacket.cpp | 4 ++-- src/profiling/test/SendCounterPacketTests.cpp | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/profiling/SendCounterPacket.cpp b/src/profiling/SendCounterPacket.cpp index d916dd8b97..21f31161f3 100644 --- a/src/profiling/SendCounterPacket.cpp +++ b/src/profiling/SendCounterPacket.cpp @@ -299,7 +299,7 @@ bool SendCounterPacket::CreateDeviceRecord(const DevicePtr& device, // Device record word 1: // 0:31 [32] name_offset: offset from the beginning of the device record pool to the name field - const uint32_t deviceRecordWord1 = 2u; // The offset is always two here, as the name field is always + const uint32_t deviceRecordWord1 = 8u; // The offset is always eight here, as the name field is always // the first (and only) item in the pool and there are two device words // Convert the device name into a SWTrace string @@ -349,7 +349,7 @@ bool SendCounterPacket::CreateCounterSetRecord(const CounterSetPtr& counterSet, // Counter set record word 1: // 0:31 [32] name_offset: offset from the beginning of the counter set pool to the name field - const uint32_t counterSetRecordWord1 = 2u; // The offset is always two here, as the name field is always + const uint32_t counterSetRecordWord1 = 8u; // The offset is always eight here, as the name field is always // the first (and only) item in the pool after the two counter set words // Convert the device name into a SWTrace namestring diff --git a/src/profiling/test/SendCounterPacketTests.cpp b/src/profiling/test/SendCounterPacketTests.cpp index 9b3a86a5f4..e7e2312cb4 100644 --- a/src/profiling/test/SendCounterPacketTests.cpp +++ b/src/profiling/test/SendCounterPacketTests.cpp @@ -430,7 +430,7 @@ BOOST_AUTO_TEST_CASE(CreateDeviceRecordTest) }; BOOST_CHECK(deviceRecordWord0[0] == deviceUid); // uid BOOST_CHECK(deviceRecordWord0[1] == deviceCores); // cores - BOOST_CHECK(deviceRecord[1] == 2); // name_offset + BOOST_CHECK(deviceRecord[1] == 8); // name_offset BOOST_CHECK(deviceRecord[2] == deviceName.size() + 1); // The length of the SWTrace string (name) BOOST_CHECK(std::memcmp(deviceRecord.data() + 3, deviceName.data(), deviceName.size()) == 0); // name } @@ -483,7 +483,7 @@ BOOST_AUTO_TEST_CASE(CreateCounterSetRecordTest) }; BOOST_CHECK(counterSetRecordWord0[0] == counterSetUid); // uid BOOST_CHECK(counterSetRecordWord0[1] == counterSetCount); // cores - BOOST_CHECK(counterSetRecord[1] == 2); // name_offset + BOOST_CHECK(counterSetRecord[1] == 8); // name_offset BOOST_CHECK(counterSetRecord[2] == counterSetName.size() + 1); // The length of the SWTrace string (name) BOOST_CHECK(std::memcmp(counterSetRecord.data() + 3, counterSetName.data(), counterSetName.size()) == 0); // name } @@ -1342,7 +1342,7 @@ BOOST_AUTO_TEST_CASE(SendCounterDirectoryPacketTest2) deviceRecord.name_offset = deviceRecordWord1; // name_offset uint32_t deviceRecordPoolOffset = deviceRecordOffsets[i] + // Packet body offset - deviceRecord.name_offset * uint32_t_size; // Device name offset + deviceRecord.name_offset; // Device name offset uint32_t deviceRecordNameLength = ReadUint32(readBuffer, deviceRecordPoolOffset); deviceRecord.name_length = deviceRecordNameLength; // name_length unsigned char deviceRecordNameNullTerminator = // name null-terminator @@ -1402,7 +1402,7 @@ BOOST_AUTO_TEST_CASE(SendCounterDirectoryPacketTest2) counterSetRecord.name_offset = counterSetRecordWord1; // name_offset uint32_t counterSetRecordPoolOffset = counterSetRecordOffsets[i] + // Packet body offset - counterSetRecord.name_offset * uint32_t_size; // Counter set name offset + counterSetRecord.name_offset; // Counter set name offset uint32_t counterSetRecordNameLength = ReadUint32(readBuffer, counterSetRecordPoolOffset); counterSetRecord.name_length = counterSetRecordNameLength; // name_length unsigned char counterSetRecordNameNullTerminator = // name null-terminator -- cgit v1.2.1