aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFinn Williams <Finn.Williams@arm.com>2020-03-20 15:10:59 +0000
committerJim Flynn <jim.flynn@arm.com>2020-03-20 17:54:15 +0000
commitcf2ad554502830804e991aca2e5b0741623119b2 (patch)
tree2148cdaf8d2f98b0fcad7f39ca5a7a92eab27206
parent586a9aac99312eb9cb304cbbd18cec46b9158e23 (diff)
downloadarmnn-cf2ad554502830804e991aca2e5b0741623119b2.tar.gz
IVGCVSW-4589 Add call to SendWellKnownLabelsAndEventClasses
Signed-off-by: Finn Williams <Finn.Williams@arm.com> Change-Id: Ia42f962ba53d7684f5ad75f5b1b91e2d9f3a2f9c
-rw-r--r--src/profiling/ConnectionAcknowledgedCommandHandler.cpp3
-rw-r--r--src/profiling/TimelineUtilityMethods.cpp28
-rw-r--r--src/profiling/TimelineUtilityMethods.hpp2
-rw-r--r--src/profiling/test/TimelineUtilityMethodsTests.cpp9
4 files changed, 22 insertions, 20 deletions
diff --git a/src/profiling/ConnectionAcknowledgedCommandHandler.cpp b/src/profiling/ConnectionAcknowledgedCommandHandler.cpp
index 72d09b3da7..0071bfc11e 100644
--- a/src/profiling/ConnectionAcknowledgedCommandHandler.cpp
+++ b/src/profiling/ConnectionAcknowledgedCommandHandler.cpp
@@ -4,6 +4,7 @@
//
#include "ConnectionAcknowledgedCommandHandler.hpp"
+#include "TimelineUtilityMethods.hpp"
#include <armnn/Exceptions.hpp>
@@ -41,6 +42,8 @@ void ConnectionAcknowledgedCommandHandler::operator()(const Packet& packet)
m_SendCounterPacket.SendCounterDirectoryPacket(m_CounterDirectory);
m_SendTimelinePacket.SendTimelineMessageDirectoryPackage();
+ TimelineUtilityMethods::SendWellKnownLabelsAndEventClasses(m_SendTimelinePacket);
+
break;
case ProfilingState::Active:
return; // NOP
diff --git a/src/profiling/TimelineUtilityMethods.cpp b/src/profiling/TimelineUtilityMethods.cpp
index ad93f4b80a..8a39ea7c4a 100644
--- a/src/profiling/TimelineUtilityMethods.cpp
+++ b/src/profiling/TimelineUtilityMethods.cpp
@@ -27,53 +27,55 @@ std::unique_ptr<TimelineUtilityMethods> TimelineUtilityMethods::GetTimelineUtils
}
-void TimelineUtilityMethods::SendWellKnownLabelsAndEventClasses()
+void TimelineUtilityMethods::SendWellKnownLabelsAndEventClasses(ISendTimelinePacket& timelinePacket)
{
// Send the "name" label, this call throws in case of error
- m_SendTimelinePacket->SendTimelineLabelBinaryPacket(LabelsAndEventClasses::NAME_GUID,
+ timelinePacket.SendTimelineLabelBinaryPacket(LabelsAndEventClasses::NAME_GUID,
LabelsAndEventClasses::NAME_LABEL);
// Send the "type" label, this call throws in case of error
- m_SendTimelinePacket->SendTimelineLabelBinaryPacket(LabelsAndEventClasses::TYPE_GUID,
+ timelinePacket.SendTimelineLabelBinaryPacket(LabelsAndEventClasses::TYPE_GUID,
LabelsAndEventClasses::TYPE_LABEL);
// Send the "index" label, this call throws in case of error
- m_SendTimelinePacket->SendTimelineLabelBinaryPacket(LabelsAndEventClasses::INDEX_GUID,
+ timelinePacket.SendTimelineLabelBinaryPacket(LabelsAndEventClasses::INDEX_GUID,
LabelsAndEventClasses::INDEX_LABEL);
// Send the "backendId" label, this call throws in case of error
- m_SendTimelinePacket->SendTimelineLabelBinaryPacket(LabelsAndEventClasses::BACKENDID_GUID,
+ timelinePacket.SendTimelineLabelBinaryPacket(LabelsAndEventClasses::BACKENDID_GUID,
LabelsAndEventClasses::BACKENDID_LABEL);
// Send the "layer" label, this call throws in case of error
- m_SendTimelinePacket->SendTimelineLabelBinaryPacket(LabelsAndEventClasses::LAYER_GUID,
+ timelinePacket.SendTimelineLabelBinaryPacket(LabelsAndEventClasses::LAYER_GUID,
LabelsAndEventClasses::LAYER);
// Send the "workload" label, this call throws in case of error
- m_SendTimelinePacket->SendTimelineLabelBinaryPacket(LabelsAndEventClasses::WORKLOAD_GUID,
+ timelinePacket.SendTimelineLabelBinaryPacket(LabelsAndEventClasses::WORKLOAD_GUID,
LabelsAndEventClasses::WORKLOAD);
// Send the "network" label, this call throws in case of error
- m_SendTimelinePacket->SendTimelineLabelBinaryPacket(LabelsAndEventClasses::NETWORK_GUID,
+ timelinePacket.SendTimelineLabelBinaryPacket(LabelsAndEventClasses::NETWORK_GUID,
LabelsAndEventClasses::NETWORK);
// Send the "connection" label, this call throws in case of error
- m_SendTimelinePacket->SendTimelineLabelBinaryPacket(LabelsAndEventClasses::CONNECTION_GUID,
+ timelinePacket.SendTimelineLabelBinaryPacket(LabelsAndEventClasses::CONNECTION_GUID,
LabelsAndEventClasses::CONNECTION);
// Send the "inference" label, this call throws in case of error
- m_SendTimelinePacket->SendTimelineLabelBinaryPacket(LabelsAndEventClasses::INFERENCE_GUID,
+ timelinePacket.SendTimelineLabelBinaryPacket(LabelsAndEventClasses::INFERENCE_GUID,
LabelsAndEventClasses::INFERENCE);
// Send the "workload_execution" label, this call throws in case of error
- m_SendTimelinePacket->SendTimelineLabelBinaryPacket(LabelsAndEventClasses::WORKLOAD_EXECUTION_GUID,
+ timelinePacket.SendTimelineLabelBinaryPacket(LabelsAndEventClasses::WORKLOAD_EXECUTION_GUID,
LabelsAndEventClasses::WORKLOAD_EXECUTION);
// Send the "start of life" event class, this call throws in case of error
- m_SendTimelinePacket->SendTimelineEventClassBinaryPacket(LabelsAndEventClasses::ARMNN_PROFILING_SOL_EVENT_CLASS);
+ timelinePacket.SendTimelineEventClassBinaryPacket(LabelsAndEventClasses::ARMNN_PROFILING_SOL_EVENT_CLASS);
// Send the "end of life" event class, this call throws in case of error
- m_SendTimelinePacket->SendTimelineEventClassBinaryPacket(LabelsAndEventClasses::ARMNN_PROFILING_EOL_EVENT_CLASS);
+ timelinePacket.SendTimelineEventClassBinaryPacket(LabelsAndEventClasses::ARMNN_PROFILING_EOL_EVENT_CLASS);
+
+ timelinePacket.Commit();
}
ProfilingDynamicGuid TimelineUtilityMethods::CreateNamedTypedEntity(const std::string& name, const std::string& type)
diff --git a/src/profiling/TimelineUtilityMethods.hpp b/src/profiling/TimelineUtilityMethods.hpp
index 17d2aac57b..4f24726307 100644
--- a/src/profiling/TimelineUtilityMethods.hpp
+++ b/src/profiling/TimelineUtilityMethods.hpp
@@ -39,7 +39,7 @@ public:
~TimelineUtilityMethods() = default;
- void SendWellKnownLabelsAndEventClasses();
+ static void SendWellKnownLabelsAndEventClasses(ISendTimelinePacket& timelinePacket);
ProfilingDynamicGuid CreateNamedTypedEntity(const std::string& name, const std::string& type);
diff --git a/src/profiling/test/TimelineUtilityMethodsTests.cpp b/src/profiling/test/TimelineUtilityMethodsTests.cpp
index 5c738b670f..43a5b0a4f5 100644
--- a/src/profiling/test/TimelineUtilityMethodsTests.cpp
+++ b/src/profiling/test/TimelineUtilityMethodsTests.cpp
@@ -80,13 +80,10 @@ BOOST_AUTO_TEST_CASE(CreateTypedLabelTest)
BOOST_AUTO_TEST_CASE(SendWellKnownLabelsAndEventClassesTest)
{
MockBufferManager mockBufferManager(1024);
- std::unique_ptr<ISendTimelinePacket> sendTimelinePacket = std::make_unique<SendTimelinePacket>(mockBufferManager);
- TimelineUtilityMethods timelineUtilityMethods(sendTimelinePacket);
-
- BOOST_CHECK_NO_THROW(timelineUtilityMethods.SendWellKnownLabelsAndEventClasses());
+ ProfilingService profilingService;
+ SendTimelinePacket sendTimelinePacket(mockBufferManager);
- // Commit all packets at once
- timelineUtilityMethods.Commit();
+ BOOST_CHECK_NO_THROW(TimelineUtilityMethods::SendWellKnownLabelsAndEventClasses(sendTimelinePacket));
// Get the readable buffer
auto readableBuffer = mockBufferManager.GetReadableBuffer();