From 0a35667e683105021834a28ac13d1d35af3a4a4e Mon Sep 17 00:00:00 2001 From: Sadik Armagan Date: Fri, 20 Mar 2020 11:11:01 +0000 Subject: IVGCVSW-4587 ArmNN failing to build in the Internal OOB * ProfilingService reference field not required in TimelineUtilityMethods Signed-off-by: Sadik Armagan Change-Id: I83ca13e577d35fb9497d7df1535607ec66c201bf --- src/profiling/TimelineUtilityMethods.cpp | 32 +++++++++++----------- src/profiling/TimelineUtilityMethods.hpp | 7 ++--- src/profiling/test/TimelineUtilityMethodsTests.cpp | 15 +++++----- 3 files changed, 26 insertions(+), 28 deletions(-) (limited to 'src') diff --git a/src/profiling/TimelineUtilityMethods.cpp b/src/profiling/TimelineUtilityMethods.cpp index 7310b759d2..ad93f4b80a 100644 --- a/src/profiling/TimelineUtilityMethods.cpp +++ b/src/profiling/TimelineUtilityMethods.cpp @@ -17,7 +17,7 @@ std::unique_ptr TimelineUtilityMethods::GetTimelineUtils if (profilingService.IsProfilingEnabled()) { std::unique_ptr sendTimelinepacket = profilingService.GetSendTimelinePacket(); - return std::make_unique(sendTimelinepacket, profilingService); + return std::make_unique(sendTimelinepacket); } else { @@ -91,7 +91,7 @@ ProfilingDynamicGuid TimelineUtilityMethods::CreateNamedTypedEntity(const std::s } // Generate dynamic GUID of the entity - ProfilingDynamicGuid entityGuid = m_ProfilingService.GetNextGuid(); + ProfilingDynamicGuid entityGuid = profiling::ProfilingService::GetNextGuid(); CreateNamedTypedEntity(entityGuid, name, type); @@ -154,7 +154,7 @@ ProfilingStaticGuid TimelineUtilityMethods::DeclareLabel(const std::string& labe } // Generate a static GUID for the given label name - ProfilingStaticGuid labelGuid = m_ProfilingService.GetStaticId(labelName); + ProfilingStaticGuid labelGuid = profiling::ProfilingService::GetStaticId(labelName); // Send the new label to the external profiling service, this call throws in case of error m_SendTimelinePacket->SendTimelineLabelBinaryPacket(labelGuid, labelName); @@ -177,7 +177,7 @@ void TimelineUtilityMethods::MarkEntityWithLabel(ProfilingGuid entityGuid, ProfilingStaticGuid labelGuid = DeclareLabel(labelName); // Generate a GUID for the label relationship - ProfilingDynamicGuid relationshipGuid = m_ProfilingService.GetNextGuid(); + ProfilingDynamicGuid relationshipGuid = profiling::ProfilingService::GetNextGuid(); // Send the new label link to the external profiling service, this call throws in case of error m_SendTimelinePacket->SendTimelineRelationshipBinaryPacket(ProfilingRelationshipType::LabelLink, @@ -186,7 +186,7 @@ void TimelineUtilityMethods::MarkEntityWithLabel(ProfilingGuid entityGuid, labelGuid); // Generate a GUID for the label relationship - ProfilingDynamicGuid relationshipLabelGuid = m_ProfilingService.GetNextGuid(); + ProfilingDynamicGuid relationshipLabelGuid = profiling::ProfilingService::GetNextGuid(); // Send the new label link to the external profiling service, this call throws in case of error m_SendTimelinePacket->SendTimelineRelationshipBinaryPacket(ProfilingRelationshipType::LabelLink, @@ -199,7 +199,7 @@ void TimelineUtilityMethods::MarkEntityWithType(ProfilingGuid entityGuid, ProfilingStaticGuid typeNameGuid) { // Generate a GUID for the label relationship - ProfilingDynamicGuid relationshipGuid = m_ProfilingService.GetNextGuid(); + ProfilingDynamicGuid relationshipGuid = profiling::ProfilingService::GetNextGuid(); // Send the new label link to the external profiling service, this call throws in case of error m_SendTimelinePacket->SendTimelineRelationshipBinaryPacket(ProfilingRelationshipType::LabelLink, @@ -208,7 +208,7 @@ void TimelineUtilityMethods::MarkEntityWithType(ProfilingGuid entityGuid, typeNameGuid); // Generate a GUID for the label relationship - ProfilingDynamicGuid relationshipLabelGuid = m_ProfilingService.GetNextGuid(); + ProfilingDynamicGuid relationshipLabelGuid = profiling::ProfilingService::GetNextGuid(); // Send the new label link to the external profiling service, this call throws in case of error m_SendTimelinePacket->SendTimelineRelationshipBinaryPacket(ProfilingRelationshipType::LabelLink, @@ -249,7 +249,7 @@ ProfilingDynamicGuid TimelineUtilityMethods::CreateNamedTypedChildEntity(Profili ProfilingDynamicGuid childEntityGuid = CreateNamedTypedEntity(entityName, entityType); // Generate a GUID for the retention link relationship - ProfilingDynamicGuid retentionLinkGuid = m_ProfilingService.GetNextGuid(); + ProfilingDynamicGuid retentionLinkGuid = profiling::ProfilingService::GetNextGuid(); // Send the new retention link to the external profiling service, this call throws in case of error m_SendTimelinePacket->SendTimelineRelationshipBinaryPacket(ProfilingRelationshipType::RetentionLink, @@ -283,7 +283,7 @@ void TimelineUtilityMethods::CreateNamedTypedChildEntity(ProfilingGuid childEnti CreateNamedTypedEntity(childEntityGuid, entityName, entityType); // Generate a GUID for the retention link relationship - ProfilingDynamicGuid retentionLinkGuid = m_ProfilingService.GetNextGuid(); + ProfilingDynamicGuid retentionLinkGuid = profiling::ProfilingService::GetNextGuid(); // Send the new retention link to the external profiling service, this call throws in case of error m_SendTimelinePacket->SendTimelineRelationshipBinaryPacket(ProfilingRelationshipType::RetentionLink, @@ -308,7 +308,7 @@ void TimelineUtilityMethods::CreateNamedTypedChildEntity(ProfilingGuid childEnti CreateNamedTypedEntity(childEntityGuid, entityName, typeGuid); // Generate a GUID for the retention link relationship - ProfilingDynamicGuid retentionLinkGuid = m_ProfilingService.GetNextGuid(); + ProfilingDynamicGuid retentionLinkGuid = profiling::ProfilingService::GetNextGuid(); // Send the new retention link to the external profiling service, this call throws in case of error m_SendTimelinePacket->SendTimelineRelationshipBinaryPacket(ProfilingRelationshipType::RetentionLink, @@ -322,7 +322,7 @@ ProfilingDynamicGuid TimelineUtilityMethods::CreateRelationship(ProfilingRelatio ProfilingGuid tailGuid) { // Generate a GUID for the relationship - ProfilingDynamicGuid relationshipGuid = m_ProfilingService.GetNextGuid(); + ProfilingDynamicGuid relationshipGuid = profiling::ProfilingService::GetNextGuid(); // Send the new retention link to the external profiling service, this call throws in case of error m_SendTimelinePacket->SendTimelineRelationshipBinaryPacket(relationshipType, @@ -337,7 +337,7 @@ ProfilingDynamicGuid TimelineUtilityMethods::CreateConnectionRelationship(Profil ProfilingGuid tailGuid) { // Generate a GUID for the relationship - ProfilingDynamicGuid relationshipGuid = m_ProfilingService.GetNextGuid(); + ProfilingDynamicGuid relationshipGuid = profiling::ProfilingService::GetNextGuid(); // Send the new retention link to the external profiling service, this call throws in case of error m_SendTimelinePacket->SendTimelineRelationshipBinaryPacket(relationshipType, @@ -367,13 +367,13 @@ ProfilingDynamicGuid TimelineUtilityMethods::RecordEvent(ProfilingGuid entityGui std::thread::id threadId = std::this_thread::get_id(); // Generate a GUID for the event - ProfilingDynamicGuid eventGuid = m_ProfilingService.GetNextGuid(); + ProfilingDynamicGuid eventGuid = profiling::ProfilingService::GetNextGuid(); // Send the new timeline event to the external profiling service, this call throws in case of error m_SendTimelinePacket->SendTimelineEventBinaryPacket(timestamp, threadId, eventGuid); // Generate a GUID for the execution link - ProfilingDynamicGuid executionLinkId = m_ProfilingService.GetNextGuid(); + ProfilingDynamicGuid executionLinkId = profiling::ProfilingService::GetNextGuid(); // Send the new execution link to the external profiling service, this call throws in case of error m_SendTimelinePacket->SendTimelineRelationshipBinaryPacket(ProfilingRelationshipType::ExecutionLink, @@ -382,7 +382,7 @@ ProfilingDynamicGuid TimelineUtilityMethods::RecordEvent(ProfilingGuid entityGui eventGuid); // Generate a GUID for the data relationship link - ProfilingDynamicGuid eventClassLinkId = m_ProfilingService.GetNextGuid(); + ProfilingDynamicGuid eventClassLinkId = profiling::ProfilingService::GetNextGuid(); // Send the new data relationship link to the external profiling service, this call throws in case of error m_SendTimelinePacket->SendTimelineRelationshipBinaryPacket(ProfilingRelationshipType::DataLink, @@ -396,7 +396,7 @@ ProfilingDynamicGuid TimelineUtilityMethods::RecordEvent(ProfilingGuid entityGui ProfilingDynamicGuid TimelineUtilityMethods::RecordWorkloadInferenceAndStartOfLifeEvent(ProfilingGuid workloadGuid, ProfilingGuid inferenceGuid) { - ProfilingDynamicGuid workloadInferenceGuid = m_ProfilingService.GetNextGuid(); + ProfilingDynamicGuid workloadInferenceGuid = profiling::ProfilingService::GetNextGuid(); CreateTypedEntity(workloadInferenceGuid, LabelsAndEventClasses::WORKLOAD_EXECUTION_GUID); CreateRelationship(ProfilingRelationshipType::RetentionLink, inferenceGuid, workloadInferenceGuid); CreateRelationship(ProfilingRelationshipType::RetentionLink, workloadGuid, workloadInferenceGuid); diff --git a/src/profiling/TimelineUtilityMethods.hpp b/src/profiling/TimelineUtilityMethods.hpp index df56cd6f42..17d2aac57b 100644 --- a/src/profiling/TimelineUtilityMethods.hpp +++ b/src/profiling/TimelineUtilityMethods.hpp @@ -25,11 +25,11 @@ public: static std::unique_ptr GetTimelineUtils(ProfilingService& profilingService); TimelineUtilityMethods( - std::unique_ptr& sendTimelinePacket, ProfilingService& profilingService) - : m_SendTimelinePacket(std::move(sendTimelinePacket)), m_ProfilingService(profilingService) {} + std::unique_ptr& sendTimelinePacket) + : m_SendTimelinePacket(std::move(sendTimelinePacket)) {} TimelineUtilityMethods(TimelineUtilityMethods&& other) - : m_SendTimelinePacket(std::move(other.m_SendTimelinePacket)), m_ProfilingService(other.m_ProfilingService) {} + : m_SendTimelinePacket(std::move(other.m_SendTimelinePacket)) {} TimelineUtilityMethods(const TimelineUtilityMethods& other) = delete; @@ -92,7 +92,6 @@ public: private: std::unique_ptr m_SendTimelinePacket; - profiling::ProfilingService& m_ProfilingService; }; } // namespace profiling diff --git a/src/profiling/test/TimelineUtilityMethodsTests.cpp b/src/profiling/test/TimelineUtilityMethodsTests.cpp index f83a9622ca..5c738b670f 100644 --- a/src/profiling/test/TimelineUtilityMethodsTests.cpp +++ b/src/profiling/test/TimelineUtilityMethodsTests.cpp @@ -26,7 +26,7 @@ BOOST_AUTO_TEST_CASE(CreateTypedLabelTest) ProfilingService profilingService; std::unique_ptr sendTimelinePacket = std::make_unique(mockBufferManager); - TimelineUtilityMethods timelineUtilityMethods(sendTimelinePacket, profilingService); + TimelineUtilityMethods timelineUtilityMethods(sendTimelinePacket); // Generate first guid to ensure that the named typed entity guid is not 0 on local single test. profilingService.NextGuid(); @@ -80,9 +80,8 @@ BOOST_AUTO_TEST_CASE(CreateTypedLabelTest) BOOST_AUTO_TEST_CASE(SendWellKnownLabelsAndEventClassesTest) { MockBufferManager mockBufferManager(1024); - ProfilingService profilingService; std::unique_ptr sendTimelinePacket = std::make_unique(mockBufferManager); - TimelineUtilityMethods timelineUtilityMethods(sendTimelinePacket, profilingService); + TimelineUtilityMethods timelineUtilityMethods(sendTimelinePacket); BOOST_CHECK_NO_THROW(timelineUtilityMethods.SendWellKnownLabelsAndEventClasses()); @@ -183,7 +182,7 @@ BOOST_AUTO_TEST_CASE(CreateNamedTypedChildEntityTest) MockBufferManager mockBufferManager(1024); ProfilingService profilingService; std::unique_ptr sendTimelinePacket = std::make_unique(mockBufferManager); - TimelineUtilityMethods timelineUtilityMethods(sendTimelinePacket, profilingService); + TimelineUtilityMethods timelineUtilityMethods(sendTimelinePacket); ProfilingDynamicGuid childEntityGuid(0); ProfilingGuid parentEntityGuid(123); @@ -282,7 +281,7 @@ BOOST_AUTO_TEST_CASE(DeclareLabelTest) MockBufferManager mockBufferManager(1024); ProfilingService profilingService; std::unique_ptr sendTimelinePacket = std::make_unique(mockBufferManager); - TimelineUtilityMethods timelineUtilityMethods(sendTimelinePacket, profilingService); + TimelineUtilityMethods timelineUtilityMethods(sendTimelinePacket); // Generate first guid to ensure that the named typed entity guid is not 0 on local single test. profilingService.NextGuid(); @@ -311,7 +310,7 @@ BOOST_AUTO_TEST_CASE(CreateNameTypeEntityInvalidTest) MockBufferManager mockBufferManager(1024); ProfilingService profilingService; std::unique_ptr sendTimelinePacket = std::make_unique(mockBufferManager); - TimelineUtilityMethods timelineUtilityMethods(sendTimelinePacket, profilingService); + TimelineUtilityMethods timelineUtilityMethods(sendTimelinePacket); // Invalid name BOOST_CHECK_THROW(timelineUtilityMethods.CreateNamedTypedEntity("", "Type"), InvalidArgumentException); @@ -336,7 +335,7 @@ BOOST_AUTO_TEST_CASE(CreateNameTypeEntityTest) MockBufferManager mockBufferManager(1024); ProfilingService profilingService; std::unique_ptr sendTimelinePacket = std::make_unique(mockBufferManager); - TimelineUtilityMethods timelineUtilityMethods(sendTimelinePacket, profilingService); + TimelineUtilityMethods timelineUtilityMethods(sendTimelinePacket); const std::string entityName = "Entity0"; const std::string entityType = "Type0"; @@ -416,7 +415,7 @@ BOOST_AUTO_TEST_CASE(RecordEventTest) MockBufferManager mockBufferManager(1024); ProfilingService profilingService; std::unique_ptr sendTimelinePacket = std::make_unique(mockBufferManager); - TimelineUtilityMethods timelineUtilityMethods(sendTimelinePacket, profilingService); + TimelineUtilityMethods timelineUtilityMethods(sendTimelinePacket); // Generate first guid to ensure that the named typed entity guid is not 0 on local single test. profilingService.NextGuid(); -- cgit v1.2.1