From: Finn Williams Date: Fri, 7 Aug 2020 10:43:24 +0000 (+0100) Subject: IVGCVSW-5170 Do not resend timeline data if TimelineReporting is already enabled X-Git-Tag: submit/tizen/20210421.062230~395 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=895e11891a82a40d6fa04dc6941d374562a882a2;p=platform%2Fupstream%2Farmnn.git IVGCVSW-5170 Do not resend timeline data if TimelineReporting is already enabled Signed-off-by: Finn Williams Change-Id: I79f19dd1c1b66d199008c0010c33b5a55e0e89f2 --- diff --git a/src/profiling/ActivateTimelineReportingCommandHandler.cpp b/src/profiling/ActivateTimelineReportingCommandHandler.cpp index 614417c..6d5f32f 100644 --- a/src/profiling/ActivateTimelineReportingCommandHandler.cpp +++ b/src/profiling/ActivateTimelineReportingCommandHandler.cpp @@ -41,15 +41,18 @@ void ActivateTimelineReportingCommandHandler::operator()(const arm::pipe::Packet + " id = " + std::to_string(packet.GetPacketId())); } - m_SendTimelinePacket.SendTimelineMessageDirectoryPackage(); + if(!m_TimelineReporting) + { + m_SendTimelinePacket.SendTimelineMessageDirectoryPackage(); - TimelineUtilityMethods::SendWellKnownLabelsAndEventClasses(m_SendTimelinePacket); + TimelineUtilityMethods::SendWellKnownLabelsAndEventClasses(m_SendTimelinePacket); - m_TimelineReporting = true; + m_TimelineReporting = true; - m_ReportStructure.value().ReportStructure(); + m_ReportStructure.value().ReportStructure(); - m_BackendNotifier.NotifyBackendsForTimelineReporting(); + m_BackendNotifier.NotifyBackendsForTimelineReporting(); + } break; default: diff --git a/tests/profiling/gatordmock/tests/GatordMockTests.cpp b/tests/profiling/gatordmock/tests/GatordMockTests.cpp index 941e284..303a36a 100644 --- a/tests/profiling/gatordmock/tests/GatordMockTests.cpp +++ b/tests/profiling/gatordmock/tests/GatordMockTests.cpp @@ -477,6 +477,10 @@ BOOST_AUTO_TEST_CASE(GatorDMockTimeLineActivation) WaitFor([&](){return mockBackEndProfilingContext->TimelineReportingEnabled();}, "Timeline packets were not activated"); + // Once TimelineReporting is Enabled additional activateTimelinePackets should be ignored + mockService.SendActivateTimelinePacket(); + mockService.SendActivateTimelinePacket(); + // Once timeline packets have been reactivated the ActivateTimelineReportingCommandHandler will resend the // SendWellKnownLabelsAndEventClasses and then send the structure of any loaded networks WaitFor([&](){return timelineDecoder.GetModel().m_Labels.size() >= 24;},