IVGCVSW-4835 Change CounterSet and Device name offsets sizes to bytes
authorFinn Williams <Finn.Williams@arm.com>
Fri, 15 May 2020 10:21:54 +0000 (11:21 +0100)
committerJim Flynn <jim.flynn@arm.com>
Fri, 15 May 2020 11:50:21 +0000 (11:50 +0000)
Signed-off-by: Finn Williams <Finn.Williams@arm.com>
Change-Id: I5dee006d5532cc85b86997a4cd0877afbf043122

src/profiling/SendCounterPacket.cpp
src/profiling/test/SendCounterPacketTests.cpp

index d916dd8..21f3116 100644 (file)
@@ -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
index 9b3a86a..e7e2312 100644 (file)
@@ -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