aboutsummaryrefslogtreecommitdiff
path: root/src/profiling/test
diff options
context:
space:
mode:
authorJim Flynn <jim.flynn@arm.com>2022-03-16 00:27:43 +0000
committerJim Flynn <jim.flynn@arm.com>2022-03-16 14:42:34 +0000
commit9c85b41a9fcb3c64d7a686373e7dde75630ccd49 (patch)
tree49ec983ec1ba499d5a5a9240b69f8f4bb9ca2082 /src/profiling/test
parent06ccd713391cca68dc8ab53b84bf058723ae55ab (diff)
downloadarmnn-9c85b41a9fcb3c64d7a686373e7dde75630ccd49.tar.gz
IVGCVSW-6852 Break the remaining dependencies on Arm NN in the profiling code
Change-Id: I18b8ca22896567904768170350ee5eb22edd4a22 Signed-off-by: Jim Flynn <jim.flynn@arm.com>
Diffstat (limited to 'src/profiling/test')
-rw-r--r--src/profiling/test/ProfilingMocks.hpp14
-rw-r--r--src/profiling/test/ProfilingTestUtils.cpp18
-rw-r--r--src/profiling/test/ProfilingTestUtils.hpp9
-rw-r--r--src/profiling/test/ProfilingTests.cpp169
-rw-r--r--src/profiling/test/ProfilingTests.hpp8
-rw-r--r--src/profiling/test/SendCounterPacketTests.cpp147
-rw-r--r--src/profiling/test/SendCounterPacketTests.hpp7
-rw-r--r--src/profiling/test/SendTimelinePacketTests.cpp19
-rw-r--r--src/profiling/test/TimelinePacketTests.cpp11
-rw-r--r--src/profiling/test/TimelineUtilityMethodsTests.cpp42
10 files changed, 351 insertions, 93 deletions
diff --git a/src/profiling/test/ProfilingMocks.hpp b/src/profiling/test/ProfilingMocks.hpp
index 1b5a36686c..cfc1096b8d 100644
--- a/src/profiling/test/ProfilingMocks.hpp
+++ b/src/profiling/test/ProfilingMocks.hpp
@@ -13,6 +13,9 @@
#include <SendCounterPacket.hpp>
#include <SendThread.hpp>
+#include <armnn/BackendId.hpp>
+#include <armnn/profiling/ArmNNProfiling.hpp>
+
#include <common/include/Assert.hpp>
#include <common/include/IgnoreUnused.hpp>
#include <common/include/NumericCast.hpp>
@@ -631,8 +634,15 @@ public:
MockBufferManager& mockBufferManager,
bool isProfilingEnabled,
const CaptureData& captureData) :
- ProfilingService(maxGlobalCounterId, initialiser),
- m_SendCounterPacket(mockBufferManager),
+ ProfilingService(maxGlobalCounterId,
+ initialiser,
+ arm::pipe::ARMNN_SOFTWARE_INFO,
+ arm::pipe::ARMNN_SOFTWARE_VERSION,
+ arm::pipe::ARMNN_HARDWARE_VERSION),
+ m_SendCounterPacket(mockBufferManager,
+ arm::pipe::ARMNN_SOFTWARE_INFO,
+ arm::pipe::ARMNN_SOFTWARE_VERSION,
+ arm::pipe::ARMNN_HARDWARE_VERSION),
m_IsProfilingEnabled(isProfilingEnabled),
m_CaptureData(captureData)
{}
diff --git a/src/profiling/test/ProfilingTestUtils.cpp b/src/profiling/test/ProfilingTestUtils.cpp
index 7fe7069c01..51aa07e163 100644
--- a/src/profiling/test/ProfilingTestUtils.cpp
+++ b/src/profiling/test/ProfilingTestUtils.cpp
@@ -12,12 +12,12 @@
#include <armnn/profiling/ArmNNProfiling.hpp>
#include <ProfilingService.hpp>
-#include <armnnUtils/Threads.hpp>
#include <common/include/Assert.hpp>
#include <common/include/LabelsAndEventClasses.hpp>
#include <common/include/NumericCast.hpp>
#include <common/include/Processes.hpp>
+#include <common/include/Threads.hpp>
#include <TestUtils.hpp>
@@ -27,9 +27,9 @@ uint32_t GetStreamMetaDataPacketSize()
{
uint32_t sizeUint32 = sizeof(uint32_t);
uint32_t payloadSize = 0;
- payloadSize += arm::pipe::numeric_cast<uint32_t>(GetSoftwareInfo().size()) + 1;
- payloadSize += arm::pipe::numeric_cast<uint32_t>(GetHardwareVersion().size()) + 1;
- payloadSize += arm::pipe::numeric_cast<uint32_t>(GetSoftwareVersion().size()) + 1;
+ payloadSize += arm::pipe::numeric_cast<uint32_t>(arm::pipe::ARMNN_SOFTWARE_INFO.size()) + 1;
+ payloadSize += arm::pipe::numeric_cast<uint32_t>(arm::pipe::ARMNN_HARDWARE_VERSION.size()) + 1;
+ payloadSize += arm::pipe::numeric_cast<uint32_t>(arm::pipe::ARMNN_SOFTWARE_VERSION.size()) + 1;
payloadSize += arm::pipe::numeric_cast<uint32_t>(GetProcessName().size()) + 1;
// Add packetVersionEntries
@@ -128,7 +128,11 @@ ProfilingGuid VerifyTimelineLabelBinaryPacketData(arm::pipe::Optional<ProfilingG
else
{
ArmNNProfilingServiceInitialiser initialiser;
- ProfilingService profilingService(arm::pipe::MAX_ARMNN_COUNTER, initialiser);
+ ProfilingService profilingService(arm::pipe::MAX_ARMNN_COUNTER,
+ initialiser,
+ arm::pipe::ARMNN_SOFTWARE_INFO,
+ arm::pipe::ARMNN_SOFTWARE_VERSION,
+ arm::pipe::ARMNN_HARDWARE_VERSION);
CHECK(readProfilingGuid == profilingService.GetStaticId(label));
}
@@ -343,7 +347,7 @@ ProfilingGuid VerifyTimelineEventBinaryPacket(arm::pipe::Optional<uint64_t> time
}
else
{
- CHECK(readThreadId == armnnUtils::Threads::GetCurrentThreadId());
+ CHECK(readThreadId == arm::pipe::GetCurrentThreadId());
}
// Check the event GUID
@@ -492,7 +496,7 @@ void VerifyPostOptimisationStructureTestImpl(armnn::BackendId backendId)
offset);
// Process ID Label
- int processID = arm::pipe::GetCurrentId();
+ int processID = arm::pipe::GetCurrentProcessId();
std::stringstream ss;
ss << processID;
std::string processIdLabel = ss.str();
diff --git a/src/profiling/test/ProfilingTestUtils.hpp b/src/profiling/test/ProfilingTestUtils.hpp
index b4aa372a98..4ff4221cab 100644
--- a/src/profiling/test/ProfilingTestUtils.hpp
+++ b/src/profiling/test/ProfilingTestUtils.hpp
@@ -11,6 +11,8 @@
#include <BufferManager.hpp>
#include <ProfilingService.hpp>
+#include <armnn/profiling/ArmNNProfiling.hpp>
+
#include <common/include/Optional.hpp>
#include <common/include/ProfilingGuid.hpp>
@@ -74,7 +76,12 @@ public:
ProfilingServiceRuntimeHelper(uint16_t maxGlobalCounterId,
IInitialiseProfilingService& initialiser,
arm::pipe::IProfilingService& profilingService)
- : ProfilingService(maxGlobalCounterId, initialiser), m_ProfilingService(profilingService) {}
+ : ProfilingService(maxGlobalCounterId,
+ initialiser,
+ arm::pipe::ARMNN_SOFTWARE_INFO,
+ arm::pipe::ARMNN_SOFTWARE_VERSION,
+ arm::pipe::ARMNN_HARDWARE_VERSION),
+ m_ProfilingService(profilingService) {}
~ProfilingServiceRuntimeHelper() = default;
BufferManager& GetProfilingBufferManager()
diff --git a/src/profiling/test/ProfilingTests.cpp b/src/profiling/test/ProfilingTests.cpp
index d635ca3fa5..19e5f1baa6 100644
--- a/src/profiling/test/ProfilingTests.cpp
+++ b/src/profiling/test/ProfilingTests.cpp
@@ -148,7 +148,10 @@ TEST_CASE("CheckCommandHandler")
TestProfilingConnectionArmnnError testProfilingConnectionArmnnError;
CounterDirectory counterDirectory;
MockBufferManager mockBuffer(1024);
- SendCounterPacket sendCounterPacket(mockBuffer);
+ SendCounterPacket sendCounterPacket(mockBuffer,
+ arm::pipe::ARMNN_SOFTWARE_INFO,
+ arm::pipe::ARMNN_SOFTWARE_VERSION,
+ arm::pipe::ARMNN_HARDWARE_VERSION);
SendThread sendThread(profilingStateMachine, mockBuffer, sendCounterPacket);
SendTimelinePacket sendTimelinePacket(mockBuffer);
MockProfilingServiceStatus mockProfilingServiceStatus;
@@ -662,7 +665,11 @@ TEST_CASE("CheckProfilingServiceDisabled")
{
ProfilingOptions options;
armnn::ArmNNProfilingServiceInitialiser initialiser;
- ProfilingService profilingService(arm::pipe::MAX_ARMNN_COUNTER, initialiser);
+ ProfilingService profilingService(arm::pipe::MAX_ARMNN_COUNTER,
+ initialiser,
+ arm::pipe::ARMNN_SOFTWARE_INFO,
+ arm::pipe::ARMNN_SOFTWARE_VERSION,
+ arm::pipe::ARMNN_HARDWARE_VERSION);
profilingService.ResetExternalProfilingOptions(options, true);
CHECK(profilingService.GetCurrentState() == ProfilingState::Uninitialised);
profilingService.Update();
@@ -673,7 +680,11 @@ TEST_CASE("CheckProfilingServiceCounterDirectory")
{
ProfilingOptions options;
armnn::ArmNNProfilingServiceInitialiser initialiser;
- ProfilingService profilingService(arm::pipe::MAX_ARMNN_COUNTER, initialiser);
+ ProfilingService profilingService(arm::pipe::MAX_ARMNN_COUNTER,
+ initialiser,
+ arm::pipe::ARMNN_SOFTWARE_INFO,
+ arm::pipe::ARMNN_SOFTWARE_VERSION,
+ arm::pipe::ARMNN_HARDWARE_VERSION);
profilingService.ResetExternalProfilingOptions(options, true);
const ICounterDirectory& counterDirectory0 = profilingService.GetCounterDirectory();
@@ -698,7 +709,11 @@ TEST_CASE("CheckProfilingServiceCounterValues")
ProfilingOptions options;
options.m_EnableProfiling = true;
armnn::ArmNNProfilingServiceInitialiser initialiser;
- ProfilingService profilingService(arm::pipe::MAX_ARMNN_COUNTER, initialiser);
+ ProfilingService profilingService(arm::pipe::MAX_ARMNN_COUNTER,
+ initialiser,
+ arm::pipe::ARMNN_SOFTWARE_INFO,
+ arm::pipe::ARMNN_SOFTWARE_VERSION,
+ arm::pipe::ARMNN_HARDWARE_VERSION);
profilingService.ResetExternalProfilingOptions(options, true);
profilingService.Update();
@@ -1806,7 +1821,10 @@ TEST_CASE("CounterSelectionCommandHandlerParseData")
TestCaptureThread captureThread;
TestReadCounterValues readCounterValues;
MockBufferManager mockBuffer(512);
- SendCounterPacket sendCounterPacket(mockBuffer);
+ SendCounterPacket sendCounterPacket(mockBuffer,
+ arm::pipe::ARMNN_SOFTWARE_INFO,
+ arm::pipe::ARMNN_SOFTWARE_VERSION,
+ arm::pipe::ARMNN_HARDWARE_VERSION);
SendThread sendThread(profilingStateMachine, mockBuffer, sendCounterPacket);
uint32_t sizeOfUint32 = arm::pipe::numeric_cast<uint32_t>(sizeof(uint32_t));
@@ -1912,8 +1930,9 @@ TEST_CASE("CheckTimelineActivationAndDeactivation")
class TestReportStructure : public IReportStructure
{
public:
- virtual void ReportStructure(arm::pipe::IProfilingService& /*profilingService*/) override
+ virtual void ReportStructure(arm::pipe::IProfilingService& profilingService) override
{
+ arm::pipe::IgnoreUnused(profilingService);
m_ReportStructureCalled = true;
}
@@ -1940,6 +1959,13 @@ TEST_CASE("CheckTimelineActivationAndDeactivation")
ProfilingStateMachine stateMachine;
TestReportStructure testReportStructure;
TestNotifyBackends testNotifyBackends;
+ armnn::ArmNNProfilingServiceInitialiser initialiser;
+ ProfilingService profilingService(arm::pipe::MAX_ARMNN_COUNTER,
+ initialiser,
+ arm::pipe::ARMNN_SOFTWARE_INFO,
+ arm::pipe::ARMNN_SOFTWARE_VERSION,
+ arm::pipe::ARMNN_HARDWARE_VERSION);
+
ActivateTimelineReportingCommandHandler activateTimelineReportingCommandHandler(0,
6,
@@ -1949,7 +1975,8 @@ TEST_CASE("CheckTimelineActivationAndDeactivation")
stateMachine,
testReportStructure,
testNotifyBackends.m_timelineReporting,
- testNotifyBackends);
+ testNotifyBackends,
+ profilingService);
// Write an "ActivateTimelineReporting" packet into the mock profiling connection, to simulate an input from an
// external profiling service
@@ -2069,7 +2096,10 @@ TEST_CASE("CheckConnectionAcknowledged")
CHECK(profilingState.GetCurrentState() == ProfilingState::Uninitialised);
CounterDirectory counterDirectory;
MockBufferManager mockBuffer(1024);
- SendCounterPacket sendCounterPacket(mockBuffer);
+ SendCounterPacket sendCounterPacket(mockBuffer,
+ arm::pipe::ARMNN_SOFTWARE_INFO,
+ arm::pipe::ARMNN_SOFTWARE_VERSION,
+ arm::pipe::ARMNN_HARDWARE_VERSION);
SendThread sendThread(profilingState, mockBuffer, sendCounterPacket);
SendTimelinePacket sendTimelinePacket(mockBuffer);
MockProfilingServiceStatus mockProfilingServiceStatus;
@@ -2375,7 +2405,10 @@ TEST_CASE("CheckPeriodicCounterCaptureThread")
std::vector<uint16_t> captureIds2;
MockBufferManager mockBuffer(512);
- SendCounterPacket sendCounterPacket(mockBuffer);
+ SendCounterPacket sendCounterPacket(mockBuffer,
+ arm::pipe::ARMNN_SOFTWARE_INFO,
+ arm::pipe::ARMNN_SOFTWARE_VERSION,
+ arm::pipe::ARMNN_HARDWARE_VERSION);
SendThread sendThread(profilingStateMachine, mockBuffer, sendCounterPacket);
std::vector<uint16_t> counterIds;
@@ -2433,7 +2466,10 @@ TEST_CASE("RequestCounterDirectoryCommandHandlerTest1")
ProfilingStateMachine profilingStateMachine;
CounterDirectory counterDirectory;
MockBufferManager mockBuffer1(1024);
- SendCounterPacket sendCounterPacket(mockBuffer1);
+ SendCounterPacket sendCounterPacket(mockBuffer1,
+ arm::pipe::ARMNN_SOFTWARE_INFO,
+ arm::pipe::ARMNN_SOFTWARE_VERSION,
+ arm::pipe::ARMNN_HARDWARE_VERSION);
SendThread sendThread(profilingStateMachine, mockBuffer1, sendCounterPacket);
MockBufferManager mockBuffer2(1024);
SendTimelinePacket sendTimelinePacket(mockBuffer2);
@@ -2493,7 +2529,10 @@ TEST_CASE("RequestCounterDirectoryCommandHandlerTest2")
ProfilingStateMachine profilingStateMachine;
CounterDirectory counterDirectory;
MockBufferManager mockBuffer1(1024);
- SendCounterPacket sendCounterPacket(mockBuffer1);
+ SendCounterPacket sendCounterPacket(mockBuffer1,
+ arm::pipe::ARMNN_SOFTWARE_INFO,
+ arm::pipe::ARMNN_SOFTWARE_VERSION,
+ arm::pipe::ARMNN_HARDWARE_VERSION);
SendThread sendThread(profilingStateMachine, mockBuffer1, sendCounterPacket);
MockBufferManager mockBuffer2(1024);
SendTimelinePacket sendTimelinePacket(mockBuffer2);
@@ -2576,7 +2615,11 @@ TEST_CASE("CheckProfilingServiceGoodConnectionAcknowledgedPacket")
ProfilingOptions options;
options.m_EnableProfiling = true;
armnn::ArmNNProfilingServiceInitialiser initialiser;
- ProfilingService profilingService(arm::pipe::MAX_ARMNN_COUNTER, initialiser);
+ ProfilingService profilingService(arm::pipe::MAX_ARMNN_COUNTER,
+ initialiser,
+ arm::pipe::ARMNN_SOFTWARE_INFO,
+ arm::pipe::ARMNN_SOFTWARE_VERSION,
+ arm::pipe::ARMNN_HARDWARE_VERSION);
profilingService.ResetExternalProfilingOptions(options, true);
// Swap the profiling connection factory in the profiling service instance with our mock one
@@ -2637,7 +2680,11 @@ TEST_CASE("CheckProfilingServiceGoodRequestCounterDirectoryPacket")
ProfilingOptions options;
options.m_EnableProfiling = true;
armnn::ArmNNProfilingServiceInitialiser initialiser;
- ProfilingService profilingService(arm::pipe::MAX_ARMNN_COUNTER, initialiser);
+ ProfilingService profilingService(arm::pipe::MAX_ARMNN_COUNTER,
+ initialiser,
+ arm::pipe::ARMNN_SOFTWARE_INFO,
+ arm::pipe::ARMNN_SOFTWARE_VERSION,
+ arm::pipe::ARMNN_HARDWARE_VERSION);
profilingService.ResetExternalProfilingOptions(options, true);
// Swap the profiling connection factory in the profiling service instance with our mock one
@@ -2696,7 +2743,11 @@ TEST_CASE("CheckProfilingServiceBadPeriodicCounterSelectionPacketInvalidCounterU
ProfilingOptions options;
options.m_EnableProfiling = true;
armnn::ArmNNProfilingServiceInitialiser initialiser;
- ProfilingService profilingService(arm::pipe::MAX_ARMNN_COUNTER, initialiser);
+ ProfilingService profilingService(arm::pipe::MAX_ARMNN_COUNTER,
+ initialiser,
+ arm::pipe::ARMNN_SOFTWARE_INFO,
+ arm::pipe::ARMNN_SOFTWARE_VERSION,
+ arm::pipe::ARMNN_HARDWARE_VERSION);
profilingService.ResetExternalProfilingOptions(options, true);
// Swap the profiling connection factory in the profiling service instance with our mock one
@@ -2776,7 +2827,11 @@ TEST_CASE("CheckProfilingServiceGoodPeriodicCounterSelectionPacketNoCounters")
ProfilingOptions options;
options.m_EnableProfiling = true;
armnn::ArmNNProfilingServiceInitialiser initialiser;
- ProfilingService profilingService(arm::pipe::MAX_ARMNN_COUNTER, initialiser);
+ ProfilingService profilingService(arm::pipe::MAX_ARMNN_COUNTER,
+ initialiser,
+ arm::pipe::ARMNN_SOFTWARE_INFO,
+ arm::pipe::ARMNN_SOFTWARE_VERSION,
+ arm::pipe::ARMNN_HARDWARE_VERSION);
profilingService.ResetExternalProfilingOptions(options, true);
// Swap the profiling connection factory in the profiling service instance with our mock one
@@ -2842,7 +2897,11 @@ TEST_CASE("CheckProfilingServiceGoodPeriodicCounterSelectionPacketSingleCounter"
ProfilingOptions options;
options.m_EnableProfiling = true;
armnn::ArmNNProfilingServiceInitialiser initialiser;
- ProfilingService profilingService(arm::pipe::MAX_ARMNN_COUNTER, initialiser);
+ ProfilingService profilingService(arm::pipe::MAX_ARMNN_COUNTER,
+ initialiser,
+ arm::pipe::ARMNN_SOFTWARE_INFO,
+ arm::pipe::ARMNN_SOFTWARE_VERSION,
+ arm::pipe::ARMNN_HARDWARE_VERSION);
profilingService.ResetExternalProfilingOptions(options, true);
// Swap the profiling connection factory in the profiling service instance with our mock one
@@ -2920,7 +2979,11 @@ TEST_CASE("CheckProfilingServiceGoodPeriodicCounterSelectionPacketMultipleCounte
ProfilingOptions options;
options.m_EnableProfiling = true;
armnn::ArmNNProfilingServiceInitialiser initialiser;
- ProfilingService profilingService(arm::pipe::MAX_ARMNN_COUNTER, initialiser);
+ ProfilingService profilingService(arm::pipe::MAX_ARMNN_COUNTER,
+ initialiser,
+ arm::pipe::ARMNN_SOFTWARE_INFO,
+ arm::pipe::ARMNN_SOFTWARE_VERSION,
+ arm::pipe::ARMNN_HARDWARE_VERSION);
profilingService.ResetExternalProfilingOptions(options, true);
// Swap the profiling connection factory in the profiling service instance with our mock one
@@ -3000,7 +3063,11 @@ TEST_CASE("CheckProfilingServiceDisconnect")
ProfilingOptions options;
options.m_EnableProfiling = true;
armnn::ArmNNProfilingServiceInitialiser initialiser;
- ProfilingService profilingService(arm::pipe::MAX_ARMNN_COUNTER, initialiser);
+ ProfilingService profilingService(arm::pipe::MAX_ARMNN_COUNTER,
+ initialiser,
+ arm::pipe::ARMNN_SOFTWARE_INFO,
+ arm::pipe::ARMNN_SOFTWARE_VERSION,
+ arm::pipe::ARMNN_HARDWARE_VERSION);
profilingService.ResetExternalProfilingOptions(options, true);
// Swap the profiling connection factory in the profiling service instance with our mock one
@@ -3059,7 +3126,11 @@ TEST_CASE("CheckProfilingServiceGoodPerJobCounterSelectionPacket")
ProfilingOptions options;
options.m_EnableProfiling = true;
armnn::ArmNNProfilingServiceInitialiser initialiser;
- ProfilingService profilingService(arm::pipe::MAX_ARMNN_COUNTER, initialiser);
+ ProfilingService profilingService(arm::pipe::MAX_ARMNN_COUNTER,
+ initialiser,
+ arm::pipe::ARMNN_SOFTWARE_INFO,
+ arm::pipe::ARMNN_SOFTWARE_VERSION,
+ arm::pipe::ARMNN_HARDWARE_VERSION);
profilingService.ResetExternalProfilingOptions(options, true);
// Swap the profiling connection factory in the profiling service instance with our mock one
@@ -3127,7 +3198,11 @@ TEST_CASE("CheckConfigureProfilingServiceOn")
ProfilingOptions options;
options.m_EnableProfiling = true;
armnn::ArmNNProfilingServiceInitialiser initialiser;
- ProfilingService profilingService(arm::pipe::MAX_ARMNN_COUNTER, initialiser);
+ ProfilingService profilingService(arm::pipe::MAX_ARMNN_COUNTER,
+ initialiser,
+ arm::pipe::ARMNN_SOFTWARE_INFO,
+ arm::pipe::ARMNN_SOFTWARE_VERSION,
+ arm::pipe::ARMNN_HARDWARE_VERSION);
CHECK(profilingService.GetCurrentState() == ProfilingState::Uninitialised);
profilingService.ConfigureProfilingService(options);
// should get as far as NOT_CONNECTED
@@ -3141,7 +3216,11 @@ TEST_CASE("CheckConfigureProfilingServiceOff")
{
ProfilingOptions options;
armnn::ArmNNProfilingServiceInitialiser initialiser;
- ProfilingService profilingService(arm::pipe::MAX_ARMNN_COUNTER, initialiser);
+ ProfilingService profilingService(arm::pipe::MAX_ARMNN_COUNTER,
+ initialiser,
+ arm::pipe::ARMNN_SOFTWARE_INFO,
+ arm::pipe::ARMNN_SOFTWARE_VERSION,
+ arm::pipe::ARMNN_HARDWARE_VERSION);
CHECK(profilingService.GetCurrentState() == ProfilingState::Uninitialised);
profilingService.ConfigureProfilingService(options);
// should not move from Uninitialised
@@ -3163,7 +3242,11 @@ TEST_CASE("CheckProfilingServiceEnabled")
ProfilingOptions options;
options.m_EnableProfiling = true;
armnn::ArmNNProfilingServiceInitialiser initialiser;
- ProfilingService profilingService(arm::pipe::MAX_ARMNN_COUNTER, initialiser);
+ ProfilingService profilingService(arm::pipe::MAX_ARMNN_COUNTER,
+ initialiser,
+ arm::pipe::ARMNN_SOFTWARE_INFO,
+ arm::pipe::ARMNN_SOFTWARE_VERSION,
+ arm::pipe::ARMNN_HARDWARE_VERSION);
profilingService.ResetExternalProfilingOptions(options, true);
CHECK(profilingService.GetCurrentState() == ProfilingState::Uninitialised);
profilingService.Update();
@@ -3196,7 +3279,11 @@ TEST_CASE("CheckProfilingServiceEnabledRuntime")
ProfilingOptions options;
armnn::ArmNNProfilingServiceInitialiser initialiser;
- ProfilingService profilingService(arm::pipe::MAX_ARMNN_COUNTER, initialiser);
+ ProfilingService profilingService(arm::pipe::MAX_ARMNN_COUNTER,
+ initialiser,
+ arm::pipe::ARMNN_SOFTWARE_INFO,
+ arm::pipe::ARMNN_SOFTWARE_VERSION,
+ arm::pipe::ARMNN_HARDWARE_VERSION);
profilingService.ResetExternalProfilingOptions(options, true);
CHECK(profilingService.GetCurrentState() == ProfilingState::Uninitialised);
profilingService.Update();
@@ -3236,7 +3323,11 @@ TEST_CASE("CheckProfilingServiceBadConnectionAcknowledgedPacket")
ProfilingOptions options;
options.m_EnableProfiling = true;
armnn::ArmNNProfilingServiceInitialiser initialiser;
- ProfilingService profilingService(arm::pipe::MAX_ARMNN_COUNTER, initialiser);
+ ProfilingService profilingService(arm::pipe::MAX_ARMNN_COUNTER,
+ initialiser,
+ arm::pipe::ARMNN_SOFTWARE_INFO,
+ arm::pipe::ARMNN_SOFTWARE_VERSION,
+ arm::pipe::ARMNN_HARDWARE_VERSION);
profilingService.ResetExternalProfilingOptions(options, true);
// Swap the profiling connection factory in the profiling service instance with our mock one
@@ -3299,7 +3390,11 @@ TEST_CASE("CheckProfilingServiceBadRequestCounterDirectoryPacket")
ProfilingOptions options;
options.m_EnableProfiling = true;
armnn::ArmNNProfilingServiceInitialiser initialiser;
- ProfilingService profilingService(arm::pipe::MAX_ARMNN_COUNTER, initialiser);
+ ProfilingService profilingService(arm::pipe::MAX_ARMNN_COUNTER,
+ initialiser,
+ arm::pipe::ARMNN_SOFTWARE_INFO,
+ arm::pipe::ARMNN_SOFTWARE_VERSION,
+ arm::pipe::ARMNN_HARDWARE_VERSION);
profilingService.ResetExternalProfilingOptions(options, true);
// Swap the profiling connection factory in the profiling service instance with our mock one
@@ -3364,7 +3459,11 @@ TEST_CASE("CheckProfilingServiceBadPeriodicCounterSelectionPacket")
ProfilingOptions options;
options.m_EnableProfiling = true;
armnn::ArmNNProfilingServiceInitialiser initialiser;
- ProfilingService profilingService(arm::pipe::MAX_ARMNN_COUNTER, initialiser);
+ ProfilingService profilingService(arm::pipe::MAX_ARMNN_COUNTER,
+ initialiser,
+ arm::pipe::ARMNN_SOFTWARE_INFO,
+ arm::pipe::ARMNN_SOFTWARE_VERSION,
+ arm::pipe::ARMNN_HARDWARE_VERSION);
profilingService.ResetExternalProfilingOptions(options, true);
// Swap the profiling connection factory in the profiling service instance with our mock one
@@ -3466,7 +3565,11 @@ TEST_CASE("CheckRegisterBackendCounters")
ProfilingOptions options;
options.m_EnableProfiling = true;
armnn::ArmNNProfilingServiceInitialiser initialiser;
- ProfilingService profilingService(arm::pipe::MAX_ARMNN_COUNTER, initialiser);
+ ProfilingService profilingService(arm::pipe::MAX_ARMNN_COUNTER,
+ initialiser,
+ arm::pipe::ARMNN_SOFTWARE_INFO,
+ arm::pipe::ARMNN_SOFTWARE_VERSION,
+ arm::pipe::ARMNN_HARDWARE_VERSION);
profilingService.ResetExternalProfilingOptions(options, true);
RegisterBackendCounters registerBackendCounters(globalCounterIds, cpuRefId, profilingService);
@@ -3516,7 +3619,11 @@ TEST_CASE("CheckCounterStatusQuery")
// Reset the profiling service to the uninitialized state
armnn::ArmNNProfilingServiceInitialiser initialiser;
- ProfilingService profilingService(arm::pipe::MAX_ARMNN_COUNTER, initialiser);
+ ProfilingService profilingService(arm::pipe::MAX_ARMNN_COUNTER,
+ initialiser,
+ arm::pipe::ARMNN_SOFTWARE_INFO,
+ arm::pipe::ARMNN_SOFTWARE_VERSION,
+ arm::pipe::ARMNN_HARDWARE_VERSION);
profilingService.ResetExternalProfilingOptions(options, true);
const std::string cpuRefId(GetComputeDeviceAsCString(armnn::Compute::CpuRef));
@@ -3727,7 +3834,11 @@ TEST_CASE("CheckFileFormat") {
options.m_FileFormat = "json";
// Enable the profiling service
armnn::ArmNNProfilingServiceInitialiser initialiser;
- ProfilingService profilingService(arm::pipe::MAX_ARMNN_COUNTER, initialiser);
+ ProfilingService profilingService(arm::pipe::MAX_ARMNN_COUNTER,
+ initialiser,
+ arm::pipe::ARMNN_SOFTWARE_INFO,
+ arm::pipe::ARMNN_SOFTWARE_VERSION,
+ arm::pipe::ARMNN_HARDWARE_VERSION);
profilingService.ResetExternalProfilingOptions(options, true);
// Start the command handler and the send thread
profilingService.Update();
diff --git a/src/profiling/test/ProfilingTests.hpp b/src/profiling/test/ProfilingTests.hpp
index e55117bbc7..e9fe57d62e 100644
--- a/src/profiling/test/ProfilingTests.hpp
+++ b/src/profiling/test/ProfilingTests.hpp
@@ -12,6 +12,8 @@
#include <IProfilingConnection.hpp>
#include <ProfilingService.hpp>
+#include <armnn/profiling/ArmNNProfiling.hpp>
+
#include <common/include/CommandHandlerFunctor.hpp>
#include <common/include/Logging.hpp>
@@ -168,7 +170,11 @@ public:
SwapProfilingConnectionFactoryHelper(uint16_t maxGlobalCounterId,
IInitialiseProfilingService& initialiser,
ProfilingService& profilingService)
- : ProfilingService(maxGlobalCounterId, initialiser)
+ : ProfilingService(maxGlobalCounterId,
+ initialiser,
+ arm::pipe::ARMNN_SOFTWARE_INFO,
+ arm::pipe::ARMNN_SOFTWARE_VERSION,
+ arm::pipe::ARMNN_HARDWARE_VERSION)
, m_ProfilingService(profilingService)
, m_MockProfilingConnectionFactory(new MockProfilingConnectionFactory())
, m_BackupProfilingConnectionFactory(nullptr)
diff --git a/src/profiling/test/SendCounterPacketTests.cpp b/src/profiling/test/SendCounterPacketTests.cpp
index bdc1d5167d..4f7886afe3 100644
--- a/src/profiling/test/SendCounterPacketTests.cpp
+++ b/src/profiling/test/SendCounterPacketTests.cpp
@@ -153,16 +153,23 @@ TEST_CASE("SendPeriodicCounterSelectionPacketTest")
{
// Error no space left in buffer
MockBufferManager mockBuffer1(10);
- SendCounterPacket sendPacket1(mockBuffer1);
+ SendCounterPacket sendPacket1(mockBuffer1,
+ arm::pipe::ARMNN_SOFTWARE_INFO,
+ arm::pipe::ARMNN_SOFTWARE_VERSION,
+ arm::pipe::ARMNN_HARDWARE_VERSION);
uint32_t capturePeriod = 1000;
std::vector<uint16_t> selectedCounterIds;
- CHECK_THROWS_AS(sendPacket1.SendPeriodicCounterSelectionPacket(capturePeriod, selectedCounterIds),
- BufferExhaustion);
+ CHECK_THROWS_AS(sendPacket1.SendPeriodicCounterSelectionPacket(
+ capturePeriod, selectedCounterIds),
+ BufferExhaustion);
// Packet without any counters
MockBufferManager mockBuffer2(512);
- SendCounterPacket sendPacket2(mockBuffer2);
+ SendCounterPacket sendPacket2(mockBuffer2,
+ arm::pipe::ARMNN_SOFTWARE_INFO,
+ arm::pipe::ARMNN_SOFTWARE_VERSION,
+ arm::pipe::ARMNN_HARDWARE_VERSION);
sendPacket2.SendPeriodicCounterSelectionPacket(capturePeriod, selectedCounterIds);
auto readBuffer2 = mockBuffer2.GetReadableBuffer();
@@ -178,7 +185,10 @@ TEST_CASE("SendPeriodicCounterSelectionPacketTest")
// Full packet message
MockBufferManager mockBuffer3(512);
- SendCounterPacket sendPacket3(mockBuffer3);
+ SendCounterPacket sendPacket3(mockBuffer3,
+ arm::pipe::ARMNN_SOFTWARE_INFO,
+ arm::pipe::ARMNN_SOFTWARE_VERSION,
+ arm::pipe::ARMNN_HARDWARE_VERSION);
selectedCounterIds.reserve(5);
selectedCounterIds.emplace_back(100);
@@ -216,7 +226,10 @@ TEST_CASE("SendPeriodicCounterCapturePacketTest")
// Error no space left in buffer
MockBufferManager mockBuffer1(10);
- SendCounterPacket sendPacket1(mockBuffer1);
+ SendCounterPacket sendPacket1(mockBuffer1,
+ arm::pipe::ARMNN_SOFTWARE_INFO,
+ arm::pipe::ARMNN_SOFTWARE_VERSION,
+ arm::pipe::ARMNN_HARDWARE_VERSION);
auto captureTimestamp = std::chrono::steady_clock::now();
uint64_t time = static_cast<uint64_t >(captureTimestamp.time_since_epoch().count());
@@ -227,7 +240,10 @@ TEST_CASE("SendPeriodicCounterCapturePacketTest")
// Packet without any counters
MockBufferManager mockBuffer2(512);
- SendCounterPacket sendPacket2(mockBuffer2);
+ SendCounterPacket sendPacket2(mockBuffer2,
+ arm::pipe::ARMNN_SOFTWARE_INFO,
+ arm::pipe::ARMNN_SOFTWARE_VERSION,
+ arm::pipe::ARMNN_HARDWARE_VERSION);
sendPacket2.SendPeriodicCounterCapturePacket(time, indexValuePairs);
auto readBuffer2 = mockBuffer2.GetReadableBuffer();
@@ -244,7 +260,10 @@ TEST_CASE("SendPeriodicCounterCapturePacketTest")
// Full packet message
MockBufferManager mockBuffer3(512);
- SendCounterPacket sendPacket3(mockBuffer3);
+ SendCounterPacket sendPacket3(mockBuffer3,
+ arm::pipe::ARMNN_SOFTWARE_INFO,
+ arm::pipe::ARMNN_SOFTWARE_VERSION,
+ arm::pipe::ARMNN_HARDWARE_VERSION);
indexValuePairs.reserve(5);
indexValuePairs.emplace_back(CounterValue{0, 100});
@@ -293,16 +312,19 @@ TEST_CASE("SendStreamMetaDataPacketTest")
// Error no space left in buffer
MockBufferManager mockBuffer1(10);
- SendCounterPacket sendPacket1(mockBuffer1);
+ SendCounterPacket sendPacket1(mockBuffer1,
+ arm::pipe::ARMNN_SOFTWARE_INFO,
+ arm::pipe::ARMNN_SOFTWARE_VERSION,
+ arm::pipe::ARMNN_HARDWARE_VERSION);
CHECK_THROWS_AS(sendPacket1.SendStreamMetaDataPacket(), BufferExhaustion);
// Full metadata packet
std::string processName = GetProcessName().substr(0, 60);
- uint32_t infoSize = arm::pipe::numeric_cast<uint32_t>(GetSoftwareInfo().size()) + 1;
- uint32_t hardwareVersionSize = arm::pipe::numeric_cast<uint32_t>(GetHardwareVersion().size()) + 1;
- uint32_t softwareVersionSize = arm::pipe::numeric_cast<uint32_t>(GetSoftwareVersion().size()) + 1;
+ uint32_t infoSize = arm::pipe::numeric_cast<uint32_t>(arm::pipe::ARMNN_SOFTWARE_INFO.size()) + 1;
+ uint32_t hardwareVersionSize = arm::pipe::numeric_cast<uint32_t>(arm::pipe::ARMNN_HARDWARE_VERSION.size()) + 1;
+ uint32_t softwareVersionSize = arm::pipe::numeric_cast<uint32_t>(arm::pipe::ARMNN_SOFTWARE_VERSION.size()) + 1;
uint32_t processNameSize = arm::pipe::numeric_cast<uint32_t>(processName.size()) + 1;
// Supported Packets
@@ -340,7 +362,10 @@ TEST_CASE("SendStreamMetaDataPacketTest")
uint32_t packetEntries = static_cast<uint32_t>(packetVersions.size());
MockBufferManager mockBuffer2(512);
- SendCounterPacket sendPacket2(mockBuffer2);
+ SendCounterPacket sendPacket2(mockBuffer2,
+ arm::pipe::ARMNN_SOFTWARE_INFO,
+ arm::pipe::ARMNN_SOFTWARE_VERSION,
+ arm::pipe::ARMNN_HARDWARE_VERSION);
sendPacket2.SendStreamMetaDataPacket();
auto readBuffer2 = mockBuffer2.GetReadableBuffer();
@@ -365,7 +390,7 @@ TEST_CASE("SendStreamMetaDataPacketTest")
offset += sizeUint32;
CHECK(ReadUint32(readBuffer2, offset) == MAX_METADATA_PACKET_LENGTH); // max_data_len
offset += sizeUint32;
- int pid = arm::pipe::GetCurrentId();
+ int pid = arm::pipe::GetCurrentProcessId();
CHECK(ReadUint32(readBuffer2, offset) == arm::pipe::numeric_cast<uint32_t>(pid));
offset += sizeUint32;
uint32_t poolOffset = 10 * sizeUint32;
@@ -390,19 +415,22 @@ TEST_CASE("SendStreamMetaDataPacketTest")
offset += sizeUint32;
if (infoSize)
{
- CHECK(strcmp(reinterpret_cast<const char *>(&readData2[offset]), GetSoftwareInfo().c_str()) == 0);
+ CHECK(strcmp(reinterpret_cast<const char *>(&readData2[offset]),
+ arm::pipe::ARMNN_SOFTWARE_INFO.c_str()) == 0);
offset += infoSize;
}
if (hardwareVersionSize)
{
- CHECK(strcmp(reinterpret_cast<const char *>(&readData2[offset]), GetHardwareVersion().c_str()) == 0);
+ CHECK(strcmp(reinterpret_cast<const char *>(&readData2[offset]),
+ arm::pipe::ARMNN_HARDWARE_VERSION.c_str()) == 0);
offset += hardwareVersionSize;
}
if (softwareVersionSize)
{
- CHECK(strcmp(reinterpret_cast<const char *>(&readData2[offset]), GetSoftwareVersion().c_str()) == 0);
+ CHECK(strcmp(reinterpret_cast<const char *>(&readData2[offset]),
+ arm::pipe::ARMNN_SOFTWARE_VERSION.c_str()) == 0);
offset += softwareVersionSize;
}
@@ -1178,7 +1206,10 @@ TEST_CASE("SendCounterDirectoryPacketTest1")
// Buffer with not enough space
MockBufferManager mockBuffer(10);
- SendCounterPacket sendCounterPacket(mockBuffer);
+ SendCounterPacket sendCounterPacket(mockBuffer,
+ arm::pipe::ARMNN_SOFTWARE_INFO,
+ arm::pipe::ARMNN_SOFTWARE_VERSION,
+ arm::pipe::ARMNN_HARDWARE_VERSION);
CHECK_THROWS_AS(sendCounterPacket.SendCounterDirectoryPacket(counterDirectory),
BufferExhaustion);
}
@@ -1276,7 +1307,10 @@ TEST_CASE("SendCounterDirectoryPacketTest2")
// Buffer with enough space
MockBufferManager mockBuffer(1024);
- SendCounterPacket sendCounterPacket(mockBuffer);
+ SendCounterPacket sendCounterPacket(mockBuffer,
+ arm::pipe::ARMNN_SOFTWARE_INFO,
+ arm::pipe::ARMNN_SOFTWARE_VERSION,
+ arm::pipe::ARMNN_HARDWARE_VERSION);
CHECK_NOTHROW(sendCounterPacket.SendCounterDirectoryPacket(counterDirectory));
// Get the readable buffer
@@ -1672,7 +1706,10 @@ TEST_CASE("SendCounterDirectoryPacketTest3")
// Buffer with enough space
MockBufferManager mockBuffer(1024);
- SendCounterPacket sendCounterPacket(mockBuffer);
+ SendCounterPacket sendCounterPacket(mockBuffer,
+ arm::pipe::ARMNN_SOFTWARE_INFO,
+ arm::pipe::ARMNN_SOFTWARE_VERSION,
+ arm::pipe::ARMNN_HARDWARE_VERSION);
CHECK_THROWS_AS(sendCounterPacket.SendCounterDirectoryPacket(counterDirectory), arm::pipe::ProfilingException);
}
@@ -1690,7 +1727,10 @@ TEST_CASE("SendCounterDirectoryPacketTest4")
// Buffer with enough space
MockBufferManager mockBuffer(1024);
- SendCounterPacket sendCounterPacket(mockBuffer);
+ SendCounterPacket sendCounterPacket(mockBuffer,
+ arm::pipe::ARMNN_SOFTWARE_INFO,
+ arm::pipe::ARMNN_SOFTWARE_VERSION,
+ arm::pipe::ARMNN_HARDWARE_VERSION);
CHECK_THROWS_AS(sendCounterPacket.SendCounterDirectoryPacket(counterDirectory), arm::pipe::ProfilingException);
}
@@ -1708,7 +1748,10 @@ TEST_CASE("SendCounterDirectoryPacketTest5")
// Buffer with enough space
MockBufferManager mockBuffer(1024);
- SendCounterPacket sendCounterPacket(mockBuffer);
+ SendCounterPacket sendCounterPacket(mockBuffer,
+ arm::pipe::ARMNN_SOFTWARE_INFO,
+ arm::pipe::ARMNN_SOFTWARE_VERSION,
+ arm::pipe::ARMNN_HARDWARE_VERSION);
CHECK_THROWS_AS(sendCounterPacket.SendCounterDirectoryPacket(counterDirectory), arm::pipe::ProfilingException);
}
@@ -1740,7 +1783,10 @@ TEST_CASE("SendCounterDirectoryPacketTest6")
// Buffer with enough space
MockBufferManager mockBuffer(1024);
- SendCounterPacket sendCounterPacket(mockBuffer);
+ SendCounterPacket sendCounterPacket(mockBuffer,
+ arm::pipe::ARMNN_SOFTWARE_INFO,
+ arm::pipe::ARMNN_SOFTWARE_VERSION,
+ arm::pipe::ARMNN_HARDWARE_VERSION);
CHECK_THROWS_AS(sendCounterPacket.SendCounterDirectoryPacket(counterDirectory), arm::pipe::ProfilingException);
}
@@ -1789,7 +1835,10 @@ TEST_CASE("SendCounterDirectoryPacketTest7")
// Buffer with enough space
MockBufferManager mockBuffer(1024);
- SendCounterPacket sendCounterPacket(mockBuffer);
+ SendCounterPacket sendCounterPacket(mockBuffer,
+ arm::pipe::ARMNN_SOFTWARE_INFO,
+ arm::pipe::ARMNN_SOFTWARE_VERSION,
+ arm::pipe::ARMNN_HARDWARE_VERSION);
CHECK_THROWS_AS(sendCounterPacket.SendCounterDirectoryPacket(counterDirectory), arm::pipe::ProfilingException);
}
@@ -1800,7 +1849,10 @@ TEST_CASE("SendThreadTest0")
MockProfilingConnection mockProfilingConnection;
MockStreamCounterBuffer mockStreamCounterBuffer(0);
- SendCounterPacket sendCounterPacket(mockStreamCounterBuffer);
+ SendCounterPacket sendCounterPacket(mockStreamCounterBuffer,
+ arm::pipe::ARMNN_SOFTWARE_INFO,
+ arm::pipe::ARMNN_SOFTWARE_VERSION,
+ arm::pipe::ARMNN_HARDWARE_VERSION);
SendThread sendThread(profilingStateMachine, mockStreamCounterBuffer, sendCounterPacket);
// Try to start the send thread many times, it must only start once
@@ -1826,7 +1878,10 @@ TEST_CASE("SendThreadTest1")
MockProfilingConnection mockProfilingConnection;
MockStreamCounterBuffer mockStreamCounterBuffer(1024);
- SendCounterPacket sendCounterPacket(mockStreamCounterBuffer);
+ SendCounterPacket sendCounterPacket(mockStreamCounterBuffer,
+ arm::pipe::ARMNN_SOFTWARE_INFO,
+ arm::pipe::ARMNN_SOFTWARE_VERSION,
+ arm::pipe::ARMNN_HARDWARE_VERSION);
SendThread sendThread(profilingStateMachine, mockStreamCounterBuffer, sendCounterPacket);
sendThread.Start(mockProfilingConnection);
@@ -1934,7 +1989,10 @@ TEST_CASE("SendThreadTest2")
MockProfilingConnection mockProfilingConnection;
MockStreamCounterBuffer mockStreamCounterBuffer(1024);
- SendCounterPacket sendCounterPacket(mockStreamCounterBuffer);
+ SendCounterPacket sendCounterPacket(mockStreamCounterBuffer,
+ arm::pipe::ARMNN_SOFTWARE_INFO,
+ arm::pipe::ARMNN_SOFTWARE_VERSION,
+ arm::pipe::ARMNN_HARDWARE_VERSION);
SendThread sendThread(profilingStateMachine, mockStreamCounterBuffer, sendCounterPacket);
sendThread.Start(mockProfilingConnection);
@@ -2052,7 +2110,10 @@ TEST_CASE("SendThreadTest3")
MockProfilingConnection mockProfilingConnection;
MockStreamCounterBuffer mockStreamCounterBuffer(1024);
- SendCounterPacket sendCounterPacket(mockStreamCounterBuffer);
+ SendCounterPacket sendCounterPacket(mockStreamCounterBuffer,
+ arm::pipe::ARMNN_SOFTWARE_INFO,
+ arm::pipe::ARMNN_SOFTWARE_VERSION,
+ arm::pipe::ARMNN_HARDWARE_VERSION);
SendThread sendThread(profilingStateMachine, mockStreamCounterBuffer, sendCounterPacket);
sendThread.Start(mockProfilingConnection);
@@ -2153,7 +2214,10 @@ TEST_CASE("SendCounterPacketTestWithSendThread")
MockProfilingConnection mockProfilingConnection;
BufferManager bufferManager(1, 1024);
- SendCounterPacket sendCounterPacket(bufferManager);
+ SendCounterPacket sendCounterPacket(bufferManager,
+ arm::pipe::ARMNN_SOFTWARE_INFO,
+ arm::pipe::ARMNN_SOFTWARE_VERSION,
+ arm::pipe::ARMNN_HARDWARE_VERSION);
SendThread sendThread(profilingStateMachine, bufferManager, sendCounterPacket, -1);
sendThread.Start(mockProfilingConnection);
@@ -2200,7 +2264,10 @@ TEST_CASE("SendThreadBufferTest")
MockProfilingConnection mockProfilingConnection;
BufferManager bufferManager(3, 1024);
- SendCounterPacket sendCounterPacket(bufferManager);
+ SendCounterPacket sendCounterPacket(bufferManager,
+ arm::pipe::ARMNN_SOFTWARE_INFO,
+ arm::pipe::ARMNN_SOFTWARE_VERSION,
+ arm::pipe::ARMNN_HARDWARE_VERSION);
SendThread sendThread(profilingStateMachine, bufferManager, sendCounterPacket, -1);
sendThread.Start(mockProfilingConnection);
@@ -2258,7 +2325,10 @@ TEST_CASE("SendThreadSendStreamMetadataPacket1")
MockProfilingConnection mockProfilingConnection;
BufferManager bufferManager(3, 1024);
- SendCounterPacket sendCounterPacket(bufferManager);
+ SendCounterPacket sendCounterPacket(bufferManager,
+ arm::pipe::ARMNN_SOFTWARE_INFO,
+ arm::pipe::ARMNN_SOFTWARE_VERSION,
+ arm::pipe::ARMNN_HARDWARE_VERSION);
SendThread sendThread(profilingStateMachine, bufferManager, sendCounterPacket);
sendThread.Start(mockProfilingConnection);
@@ -2273,7 +2343,10 @@ TEST_CASE("SendThreadSendStreamMetadataPacket2")
MockProfilingConnection mockProfilingConnection;
BufferManager bufferManager(3, 1024);
- SendCounterPacket sendCounterPacket(bufferManager);
+ SendCounterPacket sendCounterPacket(bufferManager,
+ arm::pipe::ARMNN_SOFTWARE_INFO,
+ arm::pipe::ARMNN_SOFTWARE_VERSION,
+ arm::pipe::ARMNN_HARDWARE_VERSION);
SendThread sendThread(profilingStateMachine, bufferManager, sendCounterPacket);
sendThread.Start(mockProfilingConnection);
@@ -2290,7 +2363,10 @@ TEST_CASE("SendThreadSendStreamMetadataPacket3")
MockProfilingConnection mockProfilingConnection;
BufferManager bufferManager(3, 1024);
- SendCounterPacket sendCounterPacket(bufferManager);
+ SendCounterPacket sendCounterPacket(bufferManager,
+ arm::pipe::ARMNN_SOFTWARE_INFO,
+ arm::pipe::ARMNN_SOFTWARE_VERSION,
+ arm::pipe::ARMNN_HARDWARE_VERSION);
SendThread sendThread(profilingStateMachine, bufferManager, sendCounterPacket);
sendThread.Start(mockProfilingConnection);
@@ -2315,7 +2391,10 @@ TEST_CASE("SendThreadSendStreamMetadataPacket4")
MockProfilingConnection mockProfilingConnection;
BufferManager bufferManager(3, 1024);
- SendCounterPacket sendCounterPacket(bufferManager);
+ SendCounterPacket sendCounterPacket(bufferManager,
+ arm::pipe::ARMNN_SOFTWARE_INFO,
+ arm::pipe::ARMNN_SOFTWARE_VERSION,
+ arm::pipe::ARMNN_HARDWARE_VERSION);
SendThread sendThread(profilingStateMachine, bufferManager, sendCounterPacket);
sendThread.Start(mockProfilingConnection);
diff --git a/src/profiling/test/SendCounterPacketTests.hpp b/src/profiling/test/SendCounterPacketTests.hpp
index 626377a960..f9448aca53 100644
--- a/src/profiling/test/SendCounterPacketTests.hpp
+++ b/src/profiling/test/SendCounterPacketTests.hpp
@@ -10,6 +10,8 @@
#include <ProfilingUtils.hpp>
#include <IProfilingConnectionFactory.hpp>
+#include <armnn/profiling/ArmNNProfiling.hpp>
+
#include <common/include/IgnoreUnused.hpp>
#include <common/include/NumericCast.hpp>
@@ -28,7 +30,10 @@ class SendCounterPacketTest : public SendCounterPacket
{
public:
SendCounterPacketTest(IBufferManager& buffer)
- : SendCounterPacket(buffer)
+ : SendCounterPacket(buffer,
+ arm::pipe::ARMNN_SOFTWARE_INFO,
+ arm::pipe::ARMNN_SOFTWARE_VERSION,
+ arm::pipe::ARMNN_HARDWARE_VERSION)
{}
bool CreateDeviceRecordTest(const DevicePtr& device,
diff --git a/src/profiling/test/SendTimelinePacketTests.cpp b/src/profiling/test/SendTimelinePacketTests.cpp
index 7f2421dbec..ad71f8fd22 100644
--- a/src/profiling/test/SendTimelinePacketTests.cpp
+++ b/src/profiling/test/SendTimelinePacketTests.cpp
@@ -13,11 +13,11 @@
#include <ProfilingUtils.hpp>
#include <SendTimelinePacket.hpp>
#include <armnn/profiling/ArmNNProfiling.hpp>
-#include <armnnUtils/Threads.hpp>
#include <TimelinePacketWriterFactory.hpp>
-#include <common/include/SwTrace.hpp>
#include <common/include/LabelsAndEventClasses.hpp>
+#include <common/include/SwTrace.hpp>
+#include <common/include/Threads.hpp>
#include <doctest/doctest.h>
@@ -339,7 +339,7 @@ TEST_CASE("SendEventClassAfterTimelineEntityPacketTest")
// Send TimelineEventBinaryPacket
const uint64_t timestamp = 456789u;
- const int threadId = armnnUtils::Threads::GetCurrentThreadId();
+ const int threadId = arm::pipe::GetCurrentThreadId();
const uint64_t eventProfilingGuid = 123456u;
sendTimelinePacket->SendTimelineEventBinaryPacket(timestamp, threadId, eventProfilingGuid);
@@ -435,7 +435,12 @@ TEST_CASE("GetGuidsFromProfilingService")
options.m_ProfilingOptions.m_EnableProfiling = true;
armnn::RuntimeImpl runtime(options);
armnn::ArmNNProfilingServiceInitialiser initialiser;
- ProfilingService profilingService(arm::pipe::MAX_ARMNN_COUNTER, initialiser, runtime);
+ ProfilingService profilingService(arm::pipe::MAX_ARMNN_COUNTER,
+ initialiser,
+ arm::pipe::ARMNN_SOFTWARE_INFO,
+ arm::pipe::ARMNN_SOFTWARE_VERSION,
+ arm::pipe::ARMNN_HARDWARE_VERSION,
+ runtime);
profilingService.ResetExternalProfilingOptions(
ConvertExternalProfilingOptions(options.m_ProfilingOptions), true);
@@ -459,7 +464,11 @@ TEST_CASE("GetTimelinePackerWriterFromProfilingService")
ProfilingOptions options;
options.m_EnableProfiling = true;
armnn::ArmNNProfilingServiceInitialiser initialiser;
- ProfilingService profilingService(arm::pipe::MAX_ARMNN_COUNTER, initialiser);
+ ProfilingService profilingService(arm::pipe::MAX_ARMNN_COUNTER,
+ initialiser,
+ arm::pipe::ARMNN_SOFTWARE_INFO,
+ arm::pipe::ARMNN_SOFTWARE_VERSION,
+ arm::pipe::ARMNN_HARDWARE_VERSION);
profilingService.ResetExternalProfilingOptions(options, true);
std::unique_ptr<ISendTimelinePacket> writer = profilingService.GetSendTimelinePacket();
diff --git a/src/profiling/test/TimelinePacketTests.cpp b/src/profiling/test/TimelinePacketTests.cpp
index f1a038555c..a64b3731ce 100644
--- a/src/profiling/test/TimelinePacketTests.cpp
+++ b/src/profiling/test/TimelinePacketTests.cpp
@@ -5,10 +5,9 @@
#include <ProfilingUtils.hpp>
-#include <armnnUtils/Threads.hpp>
-
#include <common/include/NumericCast.hpp>
#include <common/include/SwTrace.hpp>
+#include <common/include/Threads.hpp>
#include <doctest/doctest.h>
@@ -729,7 +728,7 @@ TEST_CASE("TimelineEventClassTestFullConstructionOfData")
TEST_CASE("TimelineEventPacketTestNoBuffer")
{
const uint64_t timestamp = 456789u;
- const int threadId = armnnUtils::Threads::GetCurrentThreadId();
+ const int threadId = arm::pipe::GetCurrentThreadId();
const uint64_t profilingGuid = 123456u;
unsigned int numberOfBytesWritten = 789u;
TimelinePacketStatus result = WriteTimelineEventBinary(timestamp,
@@ -747,7 +746,7 @@ TEST_CASE("TimelineEventPacketTestBufferExhaustionZeroValue")
std::vector<unsigned char> buffer(512, 0);
const uint64_t timestamp = 456789u;
- const int threadId = armnnUtils::Threads::GetCurrentThreadId();
+ const int threadId = arm::pipe::GetCurrentThreadId();
const uint64_t profilingGuid = 123456u;
unsigned int numberOfBytesWritten = 789u;
TimelinePacketStatus result = WriteTimelineEventBinary(timestamp,
@@ -765,7 +764,7 @@ TEST_CASE("TimelineEventPacketTestBufferExhaustionFixedValue")
std::vector<unsigned char> buffer(10, 0);
const uint64_t timestamp = 456789u;
- const int threadId = armnnUtils::Threads::GetCurrentThreadId();
+ const int threadId = arm::pipe::GetCurrentThreadId();
const uint64_t profilingGuid = 123456u;
unsigned int numberOfBytesWritten = 789u;
TimelinePacketStatus result = WriteTimelineEventBinary(timestamp,
@@ -783,7 +782,7 @@ TEST_CASE("TimelineEventPacketTestFullConstructionOfData")
std::vector<unsigned char> buffer(512, 0);
const uint64_t timestamp = 456789u;
- const int threadId = armnnUtils::Threads::GetCurrentThreadId();
+ const int threadId = arm::pipe::GetCurrentThreadId();
const uint64_t profilingGuid = 123456u;
unsigned int numberOfBytesWritten = 789u;
TimelinePacketStatus result = WriteTimelineEventBinary(timestamp,
diff --git a/src/profiling/test/TimelineUtilityMethodsTests.cpp b/src/profiling/test/TimelineUtilityMethodsTests.cpp
index 7e95df1c14..66cb0e92e8 100644
--- a/src/profiling/test/TimelineUtilityMethodsTests.cpp
+++ b/src/profiling/test/TimelineUtilityMethodsTests.cpp
@@ -28,7 +28,11 @@ TEST_CASE("CreateTypedLabelTest")
{
MockBufferManager mockBufferManager(1024);
armnn::ArmNNProfilingServiceInitialiser initialiser;
- ProfilingService profilingService(arm::pipe::MAX_ARMNN_COUNTER, initialiser);
+ ProfilingService profilingService(arm::pipe::MAX_ARMNN_COUNTER,
+ initialiser,
+ arm::pipe::ARMNN_SOFTWARE_INFO,
+ arm::pipe::ARMNN_SOFTWARE_VERSION,
+ arm::pipe::ARMNN_HARDWARE_VERSION);
std::unique_ptr<ISendTimelinePacket> sendTimelinePacket = std::make_unique<SendTimelinePacket>(mockBufferManager);
TimelineUtilityMethods timelineUtilityMethods(sendTimelinePacket);
@@ -79,7 +83,11 @@ TEST_CASE("SendWellKnownLabelsAndEventClassesTest")
{
MockBufferManager mockBufferManager(1024);
armnn::ArmNNProfilingServiceInitialiser initialiser;
- ProfilingService profilingService(arm::pipe::MAX_ARMNN_COUNTER, initialiser);
+ ProfilingService profilingService(arm::pipe::MAX_ARMNN_COUNTER,
+ initialiser,
+ arm::pipe::ARMNN_SOFTWARE_INFO,
+ arm::pipe::ARMNN_SOFTWARE_VERSION,
+ arm::pipe::ARMNN_HARDWARE_VERSION);
SendTimelinePacket sendTimelinePacket(mockBufferManager);
CHECK_NOTHROW(TimelineUtilityMethods::SendWellKnownLabelsAndEventClasses(sendTimelinePacket));
@@ -207,7 +215,11 @@ TEST_CASE("CreateNamedTypedChildEntityTest")
{
MockBufferManager mockBufferManager(1024);
armnn::ArmNNProfilingServiceInitialiser initialiser;
- ProfilingService profilingService(arm::pipe::MAX_ARMNN_COUNTER, initialiser);
+ ProfilingService profilingService(arm::pipe::MAX_ARMNN_COUNTER,
+ initialiser,
+ arm::pipe::ARMNN_SOFTWARE_INFO,
+ arm::pipe::ARMNN_SOFTWARE_VERSION,
+ arm::pipe::ARMNN_HARDWARE_VERSION);
std::unique_ptr<ISendTimelinePacket> sendTimelinePacket = std::make_unique<SendTimelinePacket>(mockBufferManager);
TimelineUtilityMethods timelineUtilityMethods(sendTimelinePacket);
@@ -295,7 +307,11 @@ TEST_CASE("DeclareLabelTest")
{
MockBufferManager mockBufferManager(1024);
armnn::ArmNNProfilingServiceInitialiser initialiser;
- ProfilingService profilingService(arm::pipe::MAX_ARMNN_COUNTER, initialiser);
+ ProfilingService profilingService(arm::pipe::MAX_ARMNN_COUNTER,
+ initialiser,
+ arm::pipe::ARMNN_SOFTWARE_INFO,
+ arm::pipe::ARMNN_SOFTWARE_VERSION,
+ arm::pipe::ARMNN_HARDWARE_VERSION);
std::unique_ptr<ISendTimelinePacket> sendTimelinePacket = std::make_unique<SendTimelinePacket>(mockBufferManager);
TimelineUtilityMethods timelineUtilityMethods(sendTimelinePacket);
@@ -325,7 +341,11 @@ TEST_CASE("CreateNameTypeEntityInvalidTest")
{
MockBufferManager mockBufferManager(1024);
armnn::ArmNNProfilingServiceInitialiser initialiser;
- ProfilingService profilingService(arm::pipe::MAX_ARMNN_COUNTER, initialiser);
+ ProfilingService profilingService(arm::pipe::MAX_ARMNN_COUNTER,
+ initialiser,
+ arm::pipe::ARMNN_SOFTWARE_INFO,
+ arm::pipe::ARMNN_SOFTWARE_VERSION,
+ arm::pipe::ARMNN_HARDWARE_VERSION);
std::unique_ptr<ISendTimelinePacket> sendTimelinePacket = std::make_unique<SendTimelinePacket>(mockBufferManager);
TimelineUtilityMethods timelineUtilityMethods(sendTimelinePacket);
@@ -351,7 +371,11 @@ TEST_CASE("CreateNameTypeEntityTest")
{
MockBufferManager mockBufferManager(1024);
armnn::ArmNNProfilingServiceInitialiser initialiser;
- ProfilingService profilingService(arm::pipe::MAX_ARMNN_COUNTER, initialiser);
+ ProfilingService profilingService(arm::pipe::MAX_ARMNN_COUNTER,
+ initialiser,
+ arm::pipe::ARMNN_SOFTWARE_INFO,
+ arm::pipe::ARMNN_SOFTWARE_VERSION,
+ arm::pipe::ARMNN_HARDWARE_VERSION);
std::unique_ptr<ISendTimelinePacket> sendTimelinePacket = std::make_unique<SendTimelinePacket>(mockBufferManager);
TimelineUtilityMethods timelineUtilityMethods(sendTimelinePacket);
@@ -419,7 +443,11 @@ TEST_CASE("RecordEventTest")
{
MockBufferManager mockBufferManager(1024);
armnn::ArmNNProfilingServiceInitialiser initialiser;
- ProfilingService profilingService(arm::pipe::MAX_ARMNN_COUNTER, initialiser);
+ ProfilingService profilingService(arm::pipe::MAX_ARMNN_COUNTER,
+ initialiser,
+ arm::pipe::ARMNN_SOFTWARE_INFO,
+ arm::pipe::ARMNN_SOFTWARE_VERSION,
+ arm::pipe::ARMNN_HARDWARE_VERSION);
std::unique_ptr<ISendTimelinePacket> sendTimelinePacket = std::make_unique<SendTimelinePacket>(mockBufferManager);
TimelineUtilityMethods timelineUtilityMethods(sendTimelinePacket);
// Generate first guid to ensure that the named typed entity guid is not 0 on local single test.