IVGCVSW-4735 Add label GUID to timeline eventClass message

Change-Id: Ie205d8146f5bb1920bf001b7623ead79e2ab9e48
Signed-off-by: Jim Flynn <jim.flynn@arm.com>
diff --git a/src/profiling/test/ProfilingTestUtils.cpp b/src/profiling/test/ProfilingTestUtils.cpp
index ff25604..20e1a9b 100644
--- a/src/profiling/test/ProfilingTestUtils.cpp
+++ b/src/profiling/test/ProfilingTestUtils.cpp
@@ -118,6 +118,7 @@
 }
 
 void VerifyTimelineEventClassBinaryPacketData(ProfilingGuid guid,
+                                              ProfilingGuid nameGuid,
                                               const unsigned char* readableData,
                                               unsigned int& offset)
 {
@@ -136,6 +137,10 @@
     uint64_t readProfilingGuid = ReadUint64(readableData, offset);
     BOOST_CHECK(readProfilingGuid == guid);
 
+    offset += uint64_t_size;
+    uint64_t readProfiilngNameGuid = ReadUint64(readableData, offset);
+    BOOST_CHECK(readProfiilngNameGuid == nameGuid);
+
     // Update the offset to allow parsing to be continued after this function returns
     offset += uint64_t_size;
 }
diff --git a/src/profiling/test/ProfilingTestUtils.hpp b/src/profiling/test/ProfilingTestUtils.hpp
index 7e4f399..2e7daab 100644
--- a/src/profiling/test/ProfilingTestUtils.hpp
+++ b/src/profiling/test/ProfilingTestUtils.hpp
@@ -33,6 +33,7 @@
                                          unsigned int& offset);
 
 void VerifyTimelineEventClassBinaryPacketData(ProfilingGuid guid,
+                                              ProfilingGuid nameGuid,
                                               const unsigned char* readableData,
                                               unsigned int& offset);
 
diff --git a/src/profiling/test/SendTimelinePacketTests.cpp b/src/profiling/test/SendTimelinePacketTests.cpp
index 6d5bf49..05a6db8 100644
--- a/src/profiling/test/SendTimelinePacketTests.cpp
+++ b/src/profiling/test/SendTimelinePacketTests.cpp
@@ -144,7 +144,9 @@
     sendTimelinePacket->SendTimelineEntityBinaryPacket(entityBinaryPacketProfilingGuid);
 
     const uint64_t eventClassBinaryPacketProfilingGuid = 789123u;
-    sendTimelinePacket->SendTimelineEventClassBinaryPacket(eventClassBinaryPacketProfilingGuid);
+    const uint64_t eventClassBinaryPacketNameGuid = 8845u;
+    sendTimelinePacket->SendTimelineEventClassBinaryPacket(
+        eventClassBinaryPacketProfilingGuid, eventClassBinaryPacketNameGuid);
 
     // Commit the messages
     sendTimelinePacket->Commit();
@@ -178,7 +180,7 @@
     uint32_t entityBinaryPacketDataLength       = (entityBinaryPacketHeaderWord1 >>  0) & 0x00FFFFFF;
 
     BOOST_CHECK(entityBinaryPacketSequenceNumbered == 0);
-    BOOST_CHECK(entityBinaryPacketDataLength       == 24);
+    BOOST_CHECK(entityBinaryPacketDataLength       == 32);
 
     // Check the decl_id
     offset += uint32_t_size;
@@ -203,6 +205,10 @@
     readProfilingGuid = ReadUint64(packetBuffer, offset);
     BOOST_CHECK(readProfilingGuid == eventClassBinaryPacketProfilingGuid);
 
+    offset += uint64_t_size;
+    uint64_t readEventClassNameGuid = ReadUint64(packetBuffer, offset);
+    BOOST_CHECK(readEventClassNameGuid == eventClassBinaryPacketNameGuid);
+
     bufferManager.MarkRead(packetBuffer);
 }
 
@@ -263,7 +269,9 @@
 
     // Send TimelineEventClassBinaryPacket
     const uint64_t eventClassBinaryPacketProfilingGuid = 789123u;
-    sendTimelinePacket->SendTimelineEventClassBinaryPacket(eventClassBinaryPacketProfilingGuid);
+    const uint64_t eventClassBinaryPacketNameGuid = 8845u;
+    sendTimelinePacket->SendTimelineEventClassBinaryPacket(
+        eventClassBinaryPacketProfilingGuid, eventClassBinaryPacketNameGuid);
 
     // Commit the buffer
     sendTimelinePacket->Commit();
@@ -291,7 +299,7 @@
     uint32_t eventClassBinaryPacketSequenceNumbered = (eventClassBinaryPacketHeaderWord1 >> 24) & 0x00000001;
     uint32_t eventClassBinaryPacketDataLength       = (eventClassBinaryPacketHeaderWord1 >>  0) & 0x00FFFFFF;
     BOOST_CHECK(eventClassBinaryPacketSequenceNumbered == 0);
-    BOOST_CHECK(eventClassBinaryPacketDataLength       == 12);
+    BOOST_CHECK(eventClassBinaryPacketDataLength       == 20);
 
     offset += uint32_t_size;
     uint32_t eventClassDeclId = ReadUint32(packetBuffer, offset);
@@ -302,6 +310,10 @@
     readProfilingGuid = ReadUint64(packetBuffer, offset);
     BOOST_CHECK(readProfilingGuid == eventClassBinaryPacketProfilingGuid);
 
+    offset += uint64_t_size;
+    uint64_t readEventClassNameGuid = ReadUint64(packetBuffer, offset);
+    BOOST_CHECK(readEventClassNameGuid == eventClassBinaryPacketNameGuid);
+
     bufferManager.MarkRead(packetBuffer);
 
     // Send TimelineEventBinaryPacket
@@ -388,7 +400,9 @@
 
     // Send TimelineEventClassBinaryPacket
     const uint64_t eventClassBinaryPacketProfilingGuid = 789123u;
-    BOOST_CHECK_THROW(sendTimelinePacket->SendTimelineEventClassBinaryPacket(eventClassBinaryPacketProfilingGuid),
+    const uint64_t eventClassBinaryPacketNameGuid = 8845u;
+    BOOST_CHECK_THROW(sendTimelinePacket->SendTimelineEventClassBinaryPacket(
+                      eventClassBinaryPacketProfilingGuid, eventClassBinaryPacketNameGuid),
                       armnn::RuntimeException);
 }
 
diff --git a/src/profiling/test/TimelinePacketTests.cpp b/src/profiling/test/TimelinePacketTests.cpp
index 8cce520..555ec67 100644
--- a/src/profiling/test/TimelinePacketTests.cpp
+++ b/src/profiling/test/TimelinePacketTests.cpp
@@ -645,8 +645,10 @@
 BOOST_AUTO_TEST_CASE(TimelineEventClassTestNoBuffer)
 {
     const uint64_t profilingGuid = 123456u;
+    const uint64_t profilingNameGuid = 3345u;
     unsigned int numberOfBytesWritten = 789u;
     TimelinePacketStatus result = WriteTimelineEventClassBinary(profilingGuid,
+                                                                profilingNameGuid,
                                                                 nullptr,
                                                                 512u,
                                                                 numberOfBytesWritten);
@@ -659,8 +661,10 @@
     std::vector<unsigned char> buffer(512, 0);
 
     const uint64_t profilingGuid = 123456u;
+    const uint64_t profilingNameGuid = 3345u;
     unsigned int numberOfBytesWritten = 789u;
     TimelinePacketStatus result = WriteTimelineEventClassBinary(profilingGuid,
+                                                                profilingNameGuid,
                                                                 buffer.data(),
                                                                 0,
                                                                 numberOfBytesWritten);
@@ -673,8 +677,10 @@
     std::vector<unsigned char> buffer(10, 0);
 
     const uint64_t profilingGuid = 123456u;
+    const uint64_t profilingNameGuid = 5564u;
     unsigned int numberOfBytesWritten = 789u;
     TimelinePacketStatus result = WriteTimelineEventClassBinary(profilingGuid,
+                                                                profilingNameGuid,
                                                                 buffer.data(),
                                                                 boost::numeric_cast<unsigned int>(buffer.size()),
                                                                 numberOfBytesWritten);
@@ -687,15 +693,18 @@
     std::vector<unsigned char> buffer(512, 0);
 
     const uint64_t profilingGuid = 123456u;
+    const uint64_t profilingNameGuid = 654321u;
     unsigned int numberOfBytesWritten = 789u;
     TimelinePacketStatus result = WriteTimelineEventClassBinary(profilingGuid,
+                                                                profilingNameGuid,
                                                                 buffer.data(),
                                                                 boost::numeric_cast<unsigned int>(buffer.size()),
                                                                 numberOfBytesWritten);
     BOOST_CHECK(result == TimelinePacketStatus::Ok);
-    BOOST_CHECK(numberOfBytesWritten == 12);
+    BOOST_CHECK(numberOfBytesWritten == 20);
 
     unsigned int uint32_t_size = sizeof(uint32_t);
+    unsigned int uint64_t_size = sizeof(uint64_t);
 
     unsigned int offset = 0;
     // Check the decl_id
@@ -706,6 +715,10 @@
     offset += uint32_t_size;
     uint64_t readProfilingGuid = ReadUint64(buffer.data(), offset);
     BOOST_CHECK(readProfilingGuid == profilingGuid);
+
+    offset += uint64_t_size;
+    uint64_t readProfilingNameGuid = ReadUint64(buffer.data(), offset);
+    BOOST_CHECK(readProfilingNameGuid == profilingNameGuid);
 }
 
 BOOST_AUTO_TEST_CASE(TimelineEventPacketTestNoBuffer)
diff --git a/src/profiling/test/TimelineUtilityMethodsTests.cpp b/src/profiling/test/TimelineUtilityMethodsTests.cpp
index 8fd8c36..815a3a0 100644
--- a/src/profiling/test/TimelineUtilityMethodsTests.cpp
+++ b/src/profiling/test/TimelineUtilityMethodsTests.cpp
@@ -82,7 +82,7 @@
     auto readableBuffer = mockBufferManager.GetReadableBuffer();
     BOOST_CHECK(readableBuffer != nullptr);
     unsigned int size = readableBuffer->GetSize();
-    BOOST_TEST(size == 300);
+    BOOST_TEST(size == 376);
     const unsigned char* readableData = readableBuffer->GetReadableData();
     BOOST_CHECK(readableData != nullptr);
 
@@ -90,7 +90,7 @@
     unsigned int offset = 0;
 
     // Verify Header
-    VerifyTimelineHeaderBinary(readableData, offset, 292);
+    VerifyTimelineHeaderBinary(readableData, offset, 368);
 
     // First "well-known" label: NAME
     VerifyTimelineLabelBinaryPacketData(LabelsAndEventClasses::NAME_GUID,
@@ -154,12 +154,24 @@
                                         offset);
 
     // First "well-known" event class: START OF LIFE
+    VerifyTimelineLabelBinaryPacketData(LabelsAndEventClasses::ARMNN_PROFILING_SOL_EVENT_CLASS_NAME_GUID,
+                                        LabelsAndEventClasses::ARMNN_PROFILING_SOL_EVENT_CLASS_NAME,
+                                        readableData,
+                                        offset);
+
     VerifyTimelineEventClassBinaryPacketData(LabelsAndEventClasses::ARMNN_PROFILING_SOL_EVENT_CLASS,
+                                             LabelsAndEventClasses::ARMNN_PROFILING_SOL_EVENT_CLASS_NAME_GUID,
                                              readableData,
                                              offset);
 
     // Second "well-known" event class: END OF LIFE
+    VerifyTimelineLabelBinaryPacketData(LabelsAndEventClasses::ARMNN_PROFILING_EOL_EVENT_CLASS_NAME_GUID,
+                                        LabelsAndEventClasses::ARMNN_PROFILING_EOL_EVENT_CLASS_NAME,
+                                        readableData,
+                                        offset);
+
     VerifyTimelineEventClassBinaryPacketData(LabelsAndEventClasses::ARMNN_PROFILING_EOL_EVENT_CLASS,
+                                             LabelsAndEventClasses::ARMNN_PROFILING_EOL_EVENT_CLASS_NAME_GUID,
                                              readableData,
                                              offset);