From 032bc74ca4bc6589a33f23db31accddc5b20baaa Mon Sep 17 00:00:00 2001 From: Finn Williams Date: Wed, 12 Feb 2020 11:02:34 +0000 Subject: IVGCVSW-4338 Implement the Activation of Counters in backends Signed-off-by: Finn Williams Change-Id: I4a2465f06e046f78242ff0a246c651638b205498 --- src/profiling/test/ProfilingTests.cpp | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'src/profiling/test/ProfilingTests.cpp') 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& 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> 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> backendProfilingContext; + CounterIdMap counterIdMap; Holder data; std::vector captureIds1 = { 0, 1 }; std::vector 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 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(); -- cgit v1.2.1