aboutsummaryrefslogtreecommitdiff
path: root/src/profiling/test
diff options
context:
space:
mode:
Diffstat (limited to 'src/profiling/test')
-rw-r--r--src/profiling/test/ProfilingTests.cpp20
-rw-r--r--src/profiling/test/SendCounterPacketTests.cpp14
-rw-r--r--src/profiling/test/SendCounterPacketTests.hpp2
3 files changed, 22 insertions, 14 deletions
diff --git a/src/profiling/test/ProfilingTests.cpp b/src/profiling/test/ProfilingTests.cpp
index 0bad66fb1c..af9f1b8fcb 100644
--- a/src/profiling/test/ProfilingTests.cpp
+++ b/src/profiling/test/ProfilingTests.cpp
@@ -536,7 +536,7 @@ BOOST_AUTO_TEST_CASE(CheckProfilingStateMachine)
void CaptureDataWriteThreadImpl(Holder& holder, uint32_t capturePeriod, const std::vector<uint16_t>& counterIds)
{
- holder.SetCaptureData(capturePeriod, counterIds);
+ holder.SetCaptureData(capturePeriod, counterIds, {});
}
void CaptureDataReadThreadImpl(const Holder& holder, CaptureData& captureData)
@@ -1764,6 +1764,9 @@ BOOST_AUTO_TEST_CASE(CounterSelectionCommandHandlerParseData)
const uint32_t packetId = 0x40000;
uint32_t version = 1;
+ const std::unordered_map<armnn::BackendId,
+ std::shared_ptr<armnn::profiling::IBackendProfilingContext>> backendProfilingContext;
+ CounterIdMap counterIdMap;
Holder holder;
TestCaptureThread captureThread;
TestReadCounterValues readCounterValues;
@@ -1790,7 +1793,8 @@ BOOST_AUTO_TEST_CASE(CounterSelectionCommandHandlerParseData)
Packet packetA(packetId, dataLength1, uniqueData1);
- PeriodicCounterSelectionCommandHandler commandHandler(familyId, packetId, version, holder, captureThread,
+ PeriodicCounterSelectionCommandHandler commandHandler(familyId, packetId, version, backendProfilingContext,
+ counterIdMap, holder, 10000u, captureThread,
readCounterValues, sendCounterPacket, profilingStateMachine);
profilingStateMachine.TransitionToState(ProfilingState::Uninitialised);
@@ -2157,6 +2161,9 @@ BOOST_AUTO_TEST_CASE(CheckPeriodicCounterCaptureThread)
ProfilingStateMachine profilingStateMachine;
+ const std::unordered_map<armnn::BackendId,
+ std::shared_ptr<armnn::profiling::IBackendProfilingContext>> backendProfilingContext;
+ CounterIdMap counterIdMap;
Holder data;
std::vector<uint16_t> captureIds1 = { 0, 1 };
std::vector<uint16_t> captureIds2;
@@ -2172,11 +2179,12 @@ BOOST_AUTO_TEST_CASE(CheckPeriodicCounterCaptureThread)
unsigned int valueB = 15;
unsigned int numSteps = 5;
- PeriodicCounterCapture periodicCounterCapture(std::ref(data), std::ref(sendCounterPacket), captureReader);
+ PeriodicCounterCapture periodicCounterCapture(std::ref(data), std::ref(sendCounterPacket), captureReader,
+ counterIdMap, backendProfilingContext);
for (unsigned int i = 0; i < numSteps; ++i)
{
- data.SetCaptureData(1, captureIds1);
+ data.SetCaptureData(1, captureIds1, {});
captureReader.SetCounterValue(0, valueA * (i + 1));
captureReader.SetCounterValue(1, valueB * (i + 1));
@@ -3344,7 +3352,7 @@ BOOST_AUTO_TEST_CASE(CheckCounterStatusQuery)
const uint32_t newCapturePeriod = 100;
// Set capture period and active counters in CaptureData
- profilingService.SetCaptureData(capturePeriod, activeGlobalCounterIds);
+ profilingService.SetCaptureData(capturePeriod, activeGlobalCounterIds, {});
// Get vector of active counters for CpuRef and CpuAcc backends
std::vector<CounterStatus> cpuRefCounterStatus = backendProfilingCpuRef.GetActiveCounters();
@@ -3373,7 +3381,7 @@ BOOST_AUTO_TEST_CASE(CheckCounterStatusQuery)
BOOST_CHECK_EQUAL(inactiveCpuAccCounter.m_Enabled, false);
// Set new capture period and new active counters in CaptureData
- profilingService.SetCaptureData(newCapturePeriod, newActiveGlobalCounterIds);
+ profilingService.SetCaptureData(newCapturePeriod, newActiveGlobalCounterIds, {});
// Get vector of active counters for CpuRef and CpuAcc backends
cpuRefCounterStatus = backendProfilingCpuRef.GetActiveCounters();
diff --git a/src/profiling/test/SendCounterPacketTests.cpp b/src/profiling/test/SendCounterPacketTests.cpp
index 9ec24e539f..b87583ce5e 100644
--- a/src/profiling/test/SendCounterPacketTests.cpp
+++ b/src/profiling/test/SendCounterPacketTests.cpp
@@ -121,7 +121,7 @@ BOOST_AUTO_TEST_CASE(MockSendCounterPacketTest)
mockBuffer.MarkRead(packetBuffer);
uint64_t timestamp = 0;
- std::vector<std::pair<uint16_t, uint32_t>> indexValuePairs;
+ std::vector<CounterValue> indexValuePairs;
mockSendCounterPacket.SendPeriodicCounterCapturePacket(timestamp, indexValuePairs);
@@ -215,7 +215,7 @@ BOOST_AUTO_TEST_CASE(SendPeriodicCounterCapturePacketTest)
auto captureTimestamp = std::chrono::steady_clock::now();
uint64_t time = static_cast<uint64_t >(captureTimestamp.time_since_epoch().count());
- std::vector<std::pair<uint16_t, uint32_t>> indexValuePairs;
+ std::vector<CounterValue> indexValuePairs;
BOOST_CHECK_THROW(sendPacket1.SendPeriodicCounterCapturePacket(time, indexValuePairs),
BufferExhaustion);
@@ -242,11 +242,11 @@ BOOST_AUTO_TEST_CASE(SendPeriodicCounterCapturePacketTest)
SendCounterPacket sendPacket3(mockBuffer3);
indexValuePairs.reserve(5);
- indexValuePairs.emplace_back(std::make_pair<uint16_t, uint32_t >(0, 100));
- indexValuePairs.emplace_back(std::make_pair<uint16_t, uint32_t >(1, 200));
- indexValuePairs.emplace_back(std::make_pair<uint16_t, uint32_t >(2, 300));
- indexValuePairs.emplace_back(std::make_pair<uint16_t, uint32_t >(3, 400));
- indexValuePairs.emplace_back(std::make_pair<uint16_t, uint32_t >(4, 500));
+ indexValuePairs.emplace_back(CounterValue{0, 100});
+ indexValuePairs.emplace_back(CounterValue{1, 200});
+ indexValuePairs.emplace_back(CounterValue{2, 300});
+ indexValuePairs.emplace_back(CounterValue{3, 400});
+ indexValuePairs.emplace_back(CounterValue{4, 500});
sendPacket3.SendPeriodicCounterCapturePacket(time, indexValuePairs);
auto readBuffer3 = mockBuffer3.GetReadableBuffer();
diff --git a/src/profiling/test/SendCounterPacketTests.hpp b/src/profiling/test/SendCounterPacketTests.hpp
index c7fc7b84ac..4118989b1b 100644
--- a/src/profiling/test/SendCounterPacketTests.hpp
+++ b/src/profiling/test/SendCounterPacketTests.hpp
@@ -406,7 +406,7 @@ public:
}
void SendPeriodicCounterCapturePacket(uint64_t timestamp,
- const std::vector<std::pair<uint16_t, uint32_t>>& values) override
+ const std::vector<CounterValue>& values) override
{
boost::ignore_unused(timestamp, values);