From 1892d210d089cfbf355b44e32feb40bcb283ffc3 Mon Sep 17 00:00:00 2001 From: Jim Flynn Date: Tue, 26 May 2020 21:10:49 +0100 Subject: IVGCVSW-4735 Add label GUID to timeline eventClass message Change-Id: Ie205d8146f5bb1920bf001b7623ead79e2ab9e48 Signed-off-by: Jim Flynn --- src/profiling/LabelsAndEventClasses.cpp | 8 ++++++ src/profiling/LabelsAndEventClasses.hpp | 6 +++++ src/profiling/ProfilingUtils.cpp | 5 +++- src/profiling/ProfilingUtils.hpp | 1 + src/profiling/SendTimelinePacket.cpp | 5 ++-- src/profiling/SendTimelinePacket.hpp | 2 +- src/profiling/TimelineUtilityMethods.cpp | 30 +++++++++++++--------- src/profiling/test/ProfilingTestUtils.cpp | 5 ++++ src/profiling/test/ProfilingTestUtils.hpp | 1 + src/profiling/test/SendTimelinePacketTests.cpp | 24 +++++++++++++---- src/profiling/test/TimelinePacketTests.cpp | 15 ++++++++++- src/profiling/test/TimelineUtilityMethodsTests.cpp | 16 ++++++++++-- .../TimelineCaptureCommandHandler.cpp | 2 ++ src/timelineDecoder/tests/TimelineTests.cpp | 14 +++++----- 14 files changed, 104 insertions(+), 30 deletions(-) (limited to 'src') diff --git a/src/profiling/LabelsAndEventClasses.cpp b/src/profiling/LabelsAndEventClasses.cpp index 42b4a9dae2..daf199258a 100644 --- a/src/profiling/LabelsAndEventClasses.cpp +++ b/src/profiling/LabelsAndEventClasses.cpp @@ -52,8 +52,16 @@ ProfilingStaticGuid LabelsAndEventClasses::WORKLOAD_EXECUTION_GUID( m_GuidGenerator.GenerateStaticId(LabelsAndEventClasses::WORKLOAD_EXECUTION)); // Event Class GUIDs +// Start of Life (SOL) +std::string LabelsAndEventClasses::ARMNN_PROFILING_SOL_EVENT_CLASS_NAME("start_of_life"); +ProfilingStaticGuid LabelsAndEventClasses::ARMNN_PROFILING_SOL_EVENT_CLASS_NAME_GUID( + m_GuidGenerator.GenerateStaticId(LabelsAndEventClasses::ARMNN_PROFILING_SOL_EVENT_CLASS_NAME)); ProfilingStaticGuid LabelsAndEventClasses::ARMNN_PROFILING_SOL_EVENT_CLASS( m_GuidGenerator.GenerateStaticId("ARMNN_PROFILING_SOL")); +// End of Life (EOL) +std::string LabelsAndEventClasses::ARMNN_PROFILING_EOL_EVENT_CLASS_NAME("end_of_life"); +ProfilingStaticGuid LabelsAndEventClasses::ARMNN_PROFILING_EOL_EVENT_CLASS_NAME_GUID( + m_GuidGenerator.GenerateStaticId(LabelsAndEventClasses::ARMNN_PROFILING_EOL_EVENT_CLASS_NAME)); ProfilingStaticGuid LabelsAndEventClasses::ARMNN_PROFILING_EOL_EVENT_CLASS( m_GuidGenerator.GenerateStaticId("ARMNN_PROFILING_EOL")); diff --git a/src/profiling/LabelsAndEventClasses.hpp b/src/profiling/LabelsAndEventClasses.hpp index d79870fba9..13332ff0ff 100644 --- a/src/profiling/LabelsAndEventClasses.hpp +++ b/src/profiling/LabelsAndEventClasses.hpp @@ -46,8 +46,14 @@ public: ARMNN_DLLEXPORT static ProfilingStaticGuid WORKLOAD_EXECUTION_GUID; // Event Class GUIDs + // Start of Life (SOL) ARMNN_DLLEXPORT static ProfilingStaticGuid ARMNN_PROFILING_SOL_EVENT_CLASS; + ARMNN_DLLEXPORT static std::string ARMNN_PROFILING_SOL_EVENT_CLASS_NAME; + ARMNN_DLLEXPORT static ProfilingStaticGuid ARMNN_PROFILING_SOL_EVENT_CLASS_NAME_GUID; + // End of Life (EOL) ARMNN_DLLEXPORT static ProfilingStaticGuid ARMNN_PROFILING_EOL_EVENT_CLASS; + ARMNN_DLLEXPORT static std::string ARMNN_PROFILING_EOL_EVENT_CLASS_NAME; + ARMNN_DLLEXPORT static ProfilingStaticGuid ARMNN_PROFILING_EOL_EVENT_CLASS_NAME_GUID; private: static ProfilingGuidGenerator m_GuidGenerator; diff --git a/src/profiling/ProfilingUtils.cpp b/src/profiling/ProfilingUtils.cpp index d83223750b..2482e2c205 100644 --- a/src/profiling/ProfilingUtils.cpp +++ b/src/profiling/ProfilingUtils.cpp @@ -755,6 +755,7 @@ TimelinePacketStatus WriteTimelineMessageDirectoryPackage(unsigned char* buffer, } TimelinePacketStatus WriteTimelineEventClassBinary(uint64_t profilingGuid, + uint64_t nameGuid, unsigned char* buffer, unsigned int remainingBufferSize, unsigned int& numberOfBytesWritten) @@ -776,7 +777,7 @@ TimelinePacketStatus WriteTimelineEventClassBinary(uint64_t profilingGuid, uint32_t declId = 2; // Calculate the length of the data (in bytes) - unsigned int dataSize = uint32_t_size + uint64_t_size; // decl_id + Profiling GUID + unsigned int dataSize = uint32_t_size + (uint64_t_size * 2); // decl_id + Profiling GUID + Name GUID // Check whether the timeline binary fits in the given buffer if (dataSize > remainingBufferSize) @@ -791,6 +792,8 @@ TimelinePacketStatus WriteTimelineEventClassBinary(uint64_t profilingGuid, WriteUint32(buffer, offset, declId); // decl_id offset += uint32_t_size; WriteUint64(buffer, offset, profilingGuid); // Profiling GUID + offset += uint64_t_size; + WriteUint64(buffer, offset, nameGuid); // Name GUID // Update the number of bytes written numberOfBytesWritten = dataSize; diff --git a/src/profiling/ProfilingUtils.hpp b/src/profiling/ProfilingUtils.hpp index 92ddfe3659..9c7ad037e5 100644 --- a/src/profiling/ProfilingUtils.hpp +++ b/src/profiling/ProfilingUtils.hpp @@ -239,6 +239,7 @@ TimelinePacketStatus WriteTimelineMessageDirectoryPackage(unsigned char* buffer, unsigned int& numberOfBytesWritten); TimelinePacketStatus WriteTimelineEventClassBinary(uint64_t profilingGuid, + uint64_t nameGuid, unsigned char* buffer, unsigned int bufferSize, unsigned int& numberOfBytesWritten); diff --git a/src/profiling/SendTimelinePacket.cpp b/src/profiling/SendTimelinePacket.cpp index db8a633468..b749b5dc72 100644 --- a/src/profiling/SendTimelinePacket.cpp +++ b/src/profiling/SendTimelinePacket.cpp @@ -94,10 +94,11 @@ void SendTimelinePacket::SendTimelineEventBinaryPacket(uint64_t timestamp, profilingGuid); } -void SendTimelinePacket::SendTimelineEventClassBinaryPacket(uint64_t profilingGuid) +void SendTimelinePacket::SendTimelineEventClassBinaryPacket(uint64_t profilingGuid, uint64_t nameGuid) { ForwardWriteBinaryFunction(WriteTimelineEventClassBinary, - profilingGuid); + profilingGuid, + nameGuid); } void SendTimelinePacket::SendTimelineLabelBinaryPacket(uint64_t profilingGuid, const std::string& label) diff --git a/src/profiling/SendTimelinePacket.hpp b/src/profiling/SendTimelinePacket.hpp index d4ea2ff0e1..b1bae04947 100644 --- a/src/profiling/SendTimelinePacket.hpp +++ b/src/profiling/SendTimelinePacket.hpp @@ -39,7 +39,7 @@ public: void SendTimelineEventBinaryPacket(uint64_t timestamp, std::thread::id threadId, uint64_t profilingGuid) override; /// Create and write a TimelineEventClassBinaryPacket from the parameters to the buffer. - void SendTimelineEventClassBinaryPacket(uint64_t profilingGuid) override; + void SendTimelineEventClassBinaryPacket(uint64_t profilingGuid, uint64_t nameGuid) override; /// Create and write a TimelineLabelBinaryPacket from the parameters to the buffer. void SendTimelineLabelBinaryPacket(uint64_t profilingGuid, const std::string& label) override; diff --git a/src/profiling/TimelineUtilityMethods.cpp b/src/profiling/TimelineUtilityMethods.cpp index b0ce998c7a..306551bdc4 100644 --- a/src/profiling/TimelineUtilityMethods.cpp +++ b/src/profiling/TimelineUtilityMethods.cpp @@ -31,49 +31,55 @@ void TimelineUtilityMethods::SendWellKnownLabelsAndEventClasses(ISendTimelinePac { // Send the "name" label, this call throws in case of error timelinePacket.SendTimelineLabelBinaryPacket(LabelsAndEventClasses::NAME_GUID, - LabelsAndEventClasses::NAME_LABEL); + LabelsAndEventClasses::NAME_LABEL); // Send the "type" label, this call throws in case of error timelinePacket.SendTimelineLabelBinaryPacket(LabelsAndEventClasses::TYPE_GUID, - LabelsAndEventClasses::TYPE_LABEL); + LabelsAndEventClasses::TYPE_LABEL); // Send the "index" label, this call throws in case of error timelinePacket.SendTimelineLabelBinaryPacket(LabelsAndEventClasses::INDEX_GUID, - LabelsAndEventClasses::INDEX_LABEL); + LabelsAndEventClasses::INDEX_LABEL); // Send the "backendId" label, this call throws in case of error timelinePacket.SendTimelineLabelBinaryPacket(LabelsAndEventClasses::BACKENDID_GUID, - LabelsAndEventClasses::BACKENDID_LABEL); + LabelsAndEventClasses::BACKENDID_LABEL); // Send the "layer" label, this call throws in case of error timelinePacket.SendTimelineLabelBinaryPacket(LabelsAndEventClasses::LAYER_GUID, - LabelsAndEventClasses::LAYER); + LabelsAndEventClasses::LAYER); // Send the "workload" label, this call throws in case of error timelinePacket.SendTimelineLabelBinaryPacket(LabelsAndEventClasses::WORKLOAD_GUID, - LabelsAndEventClasses::WORKLOAD); + LabelsAndEventClasses::WORKLOAD); // Send the "network" label, this call throws in case of error timelinePacket.SendTimelineLabelBinaryPacket(LabelsAndEventClasses::NETWORK_GUID, - LabelsAndEventClasses::NETWORK); + LabelsAndEventClasses::NETWORK); // Send the "connection" label, this call throws in case of error timelinePacket.SendTimelineLabelBinaryPacket(LabelsAndEventClasses::CONNECTION_GUID, - LabelsAndEventClasses::CONNECTION); + LabelsAndEventClasses::CONNECTION); // Send the "inference" label, this call throws in case of error timelinePacket.SendTimelineLabelBinaryPacket(LabelsAndEventClasses::INFERENCE_GUID, - LabelsAndEventClasses::INFERENCE); + LabelsAndEventClasses::INFERENCE); // Send the "workload_execution" label, this call throws in case of error timelinePacket.SendTimelineLabelBinaryPacket(LabelsAndEventClasses::WORKLOAD_EXECUTION_GUID, - LabelsAndEventClasses::WORKLOAD_EXECUTION); + LabelsAndEventClasses::WORKLOAD_EXECUTION); // Send the "start of life" event class, this call throws in case of error - timelinePacket.SendTimelineEventClassBinaryPacket(LabelsAndEventClasses::ARMNN_PROFILING_SOL_EVENT_CLASS); + timelinePacket.SendTimelineLabelBinaryPacket(LabelsAndEventClasses::ARMNN_PROFILING_SOL_EVENT_CLASS_NAME_GUID, + LabelsAndEventClasses::ARMNN_PROFILING_SOL_EVENT_CLASS_NAME); + timelinePacket.SendTimelineEventClassBinaryPacket(LabelsAndEventClasses::ARMNN_PROFILING_SOL_EVENT_CLASS, + LabelsAndEventClasses::ARMNN_PROFILING_SOL_EVENT_CLASS_NAME_GUID); // Send the "end of life" event class, this call throws in case of error - timelinePacket.SendTimelineEventClassBinaryPacket(LabelsAndEventClasses::ARMNN_PROFILING_EOL_EVENT_CLASS); + timelinePacket.SendTimelineLabelBinaryPacket(LabelsAndEventClasses::ARMNN_PROFILING_EOL_EVENT_CLASS_NAME_GUID, + LabelsAndEventClasses::ARMNN_PROFILING_EOL_EVENT_CLASS_NAME); + timelinePacket.SendTimelineEventClassBinaryPacket(LabelsAndEventClasses::ARMNN_PROFILING_EOL_EVENT_CLASS, + LabelsAndEventClasses::ARMNN_PROFILING_EOL_EVENT_CLASS_NAME_GUID); timelinePacket.Commit(); } diff --git a/src/profiling/test/ProfilingTestUtils.cpp b/src/profiling/test/ProfilingTestUtils.cpp index ff256047be..20e1a9b446 100644 --- a/src/profiling/test/ProfilingTestUtils.cpp +++ b/src/profiling/test/ProfilingTestUtils.cpp @@ -118,6 +118,7 @@ void VerifyTimelineLabelBinaryPacketData(Optional guid, } void VerifyTimelineEventClassBinaryPacketData(ProfilingGuid guid, + ProfilingGuid nameGuid, const unsigned char* readableData, unsigned int& offset) { @@ -136,6 +137,10 @@ void VerifyTimelineEventClassBinaryPacketData(ProfilingGuid guid, 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 7e4f399eba..2e7daabda7 100644 --- a/src/profiling/test/ProfilingTestUtils.hpp +++ b/src/profiling/test/ProfilingTestUtils.hpp @@ -33,6 +33,7 @@ void VerifyTimelineLabelBinaryPacketData(Optional guid, 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 6d5bf490a8..05a6db8d1d 100644 --- a/src/profiling/test/SendTimelinePacketTests.cpp +++ b/src/profiling/test/SendTimelinePacketTests.cpp @@ -144,7 +144,9 @@ BOOST_AUTO_TEST_CASE(SendTimelineEntityWithEventClassPacketTest) 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 @@ BOOST_AUTO_TEST_CASE(SendTimelineEntityWithEventClassPacketTest) 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 @@ BOOST_AUTO_TEST_CASE(SendTimelineEntityWithEventClassPacketTest) 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 @@ BOOST_AUTO_TEST_CASE(SendEventClassAfterTimelineEntityPacketTest) // 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 @@ BOOST_AUTO_TEST_CASE(SendEventClassAfterTimelineEntityPacketTest) 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 @@ BOOST_AUTO_TEST_CASE(SendEventClassAfterTimelineEntityPacketTest) 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 @@ BOOST_AUTO_TEST_CASE(SendTimelinePacketTests3) // 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 8cce520da2..555ec670bd 100644 --- a/src/profiling/test/TimelinePacketTests.cpp +++ b/src/profiling/test/TimelinePacketTests.cpp @@ -645,8 +645,10 @@ BOOST_AUTO_TEST_CASE(TimelineEntityPacketTestFullConstructionOfData) 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 @@ BOOST_AUTO_TEST_CASE(TimelineEventClassTestBufferExhaustionZeroValue) std::vector 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 @@ BOOST_AUTO_TEST_CASE(TimelineEventClassTestBufferExhaustionFixedValue) std::vector 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(buffer.size()), numberOfBytesWritten); @@ -687,15 +693,18 @@ BOOST_AUTO_TEST_CASE(TimelineEventClassTestFullConstructionOfData) std::vector 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(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 @@ BOOST_AUTO_TEST_CASE(TimelineEventClassTestFullConstructionOfData) 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 8fd8c369f4..815a3a0f95 100644 --- a/src/profiling/test/TimelineUtilityMethodsTests.cpp +++ b/src/profiling/test/TimelineUtilityMethodsTests.cpp @@ -82,7 +82,7 @@ BOOST_AUTO_TEST_CASE(SendWellKnownLabelsAndEventClassesTest) 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 @@ BOOST_AUTO_TEST_CASE(SendWellKnownLabelsAndEventClassesTest) 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 @@ BOOST_AUTO_TEST_CASE(SendWellKnownLabelsAndEventClassesTest) 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); diff --git a/src/timelineDecoder/TimelineCaptureCommandHandler.cpp b/src/timelineDecoder/TimelineCaptureCommandHandler.cpp index 69389115a0..9d1e8eee16 100644 --- a/src/timelineDecoder/TimelineCaptureCommandHandler.cpp +++ b/src/timelineDecoder/TimelineCaptureCommandHandler.cpp @@ -89,6 +89,8 @@ void TimelineCaptureCommandHandler::ReadEventClass(const unsigned char* data, ui ITimelineDecoder::EventClass eventClass; eventClass.m_Guid = profiling::ReadUint64(data, offset); offset += uint64_t_size; + eventClass.m_NameGuid = profiling::ReadUint64(data, offset); + offset += uint64_t_size; m_TimelineDecoder.CreateEventClass(eventClass); } diff --git a/src/timelineDecoder/tests/TimelineTests.cpp b/src/timelineDecoder/tests/TimelineTests.cpp index 390b589b7f..8d0b8a0f08 100644 --- a/src/timelineDecoder/tests/TimelineTests.cpp +++ b/src/timelineDecoder/tests/TimelineTests.cpp @@ -168,6 +168,7 @@ BOOST_AUTO_TEST_CASE(TimelineCaptureTest) const uint64_t entityGuid = 111111u; const uint64_t eventClassGuid = 22222u; + const uint64_t eventClassNameGuid = 22322u; const uint64_t timestamp = 33333u; const uint64_t eventGuid = 44444u; @@ -205,7 +206,7 @@ BOOST_AUTO_TEST_CASE(TimelineCaptureTest) timelineCaptureCommandHandler); // Send event class - sendTimelinePacket->SendTimelineEventClassBinaryPacket(eventClassGuid); + sendTimelinePacket->SendTimelineEventClassBinaryPacket(eventClassGuid, eventClassNameGuid); sendTimelinePacket->Commit(); SendTimelinePacketToCommandHandler(bufferManager.GetReadableBuffer()->GetReadableData(), timelineCaptureCommandHandler); @@ -278,10 +279,11 @@ BOOST_AUTO_TEST_CASE(TimelineCaptureTestMultipleStringsInBuffer) BOOST_CHECK(timelineDecoder.SetLabelCallback(PushLabel) == Status::TimelineStatus_Success); BOOST_CHECK(timelineDecoder.SetRelationshipCallback(PushRelationship) == Status::TimelineStatus_Success); - const uint64_t entityGuid = 111111u; - const uint64_t eventClassGuid = 22222u; - const uint64_t timestamp = 33333u; - const uint64_t eventGuid = 44444u; + const uint64_t entityGuid = 111111u; + const uint64_t eventClassGuid = 22222u; + const uint64_t eventClassNameGuid = 22322u; + const uint64_t timestamp = 33333u; + const uint64_t eventGuid = 44444u; const std::thread::id threadId = std::this_thread::get_id(); @@ -316,7 +318,7 @@ BOOST_AUTO_TEST_CASE(TimelineCaptureTestMultipleStringsInBuffer) // Send entity sendTimelinePacket->SendTimelineEntityBinaryPacket(entityGuid); // Send event class - sendTimelinePacket->SendTimelineEventClassBinaryPacket(eventClassGuid); + sendTimelinePacket->SendTimelineEventClassBinaryPacket(eventClassGuid, eventClassNameGuid); // Send event sendTimelinePacket->SendTimelineEventBinaryPacket(timestamp, threadId, eventGuid); // Send label -- cgit v1.2.1