aboutsummaryrefslogtreecommitdiff
path: root/src/profiling/PeriodicCounterSelectionCommandHandler.hpp
diff options
context:
space:
mode:
authorMatteo Martincigh <matteo.martincigh@arm.com>2019-10-10 14:08:21 +0100
committerMatteo Martincigh <matteo.martincigh@arm.com>2019-10-11 16:33:29 +0100
commite848538efbdf01aa0b067da942c3c214f8e62826 (patch)
treed700239f1316a098849fcfc39ec70e926f86fd62 /src/profiling/PeriodicCounterSelectionCommandHandler.hpp
parentf982deaefbe5fe5814487b27f7099829839b8666 (diff)
downloadarmnn-e848538efbdf01aa0b067da942c3c214f8e62826.tar.gz
IVGCVSW-3964 Implement the Periodic Counter Selection command handler
* Improved the PeriodicCounterPacket class to handle errors properly * Improved the PeriodicCounterSelectionCommandHandler to handle invalid counter UIDs in the selection packet * Added the Periodic Counter Selection command handler to the ProfilingService class * Code refactoring and added comments * Added WaitForPacketSent method to the SendCounterPacket class to allow waiting for the packets to be sent (useful in the unit tests) * Added unit tests and updated the old ones accordingly * Fixed threading issues with a number of unit tests Signed-off-by: Matteo Martincigh <matteo.martincigh@arm.com> Change-Id: I271b7b0bfa801d88fe1725b934d24e30cd839ed7
Diffstat (limited to 'src/profiling/PeriodicCounterSelectionCommandHandler.hpp')
-rw-r--r--src/profiling/PeriodicCounterSelectionCommandHandler.hpp31
1 files changed, 18 insertions, 13 deletions
diff --git a/src/profiling/PeriodicCounterSelectionCommandHandler.hpp b/src/profiling/PeriodicCounterSelectionCommandHandler.hpp
index e247e7773f..1da08e3c7a 100644
--- a/src/profiling/PeriodicCounterSelectionCommandHandler.hpp
+++ b/src/profiling/PeriodicCounterSelectionCommandHandler.hpp
@@ -10,10 +10,7 @@
#include "Holder.hpp"
#include "SendCounterPacket.hpp"
#include "IPeriodicCounterCapture.hpp"
-
-#include <vector>
-#include <thread>
-#include <atomic>
+#include "ICounterValues.hpp"
namespace armnn
{
@@ -25,22 +22,30 @@ class PeriodicCounterSelectionCommandHandler : public CommandHandlerFunctor
{
public:
- PeriodicCounterSelectionCommandHandler(uint32_t packetId, uint32_t version, Holder& captureDataHolder,
- IPeriodicCounterCapture& captureThread,
- ISendCounterPacket& sendCounterPacket)
- : CommandHandlerFunctor(packetId, version),
- m_CaptureDataHolder(captureDataHolder),
- m_CaptureThread(captureThread),
- m_SendCounterPacket(sendCounterPacket)
+ PeriodicCounterSelectionCommandHandler(uint32_t packetId,
+ uint32_t version,
+ Holder& captureDataHolder,
+ IPeriodicCounterCapture& periodicCounterCapture,
+ const IReadCounterValues& readCounterValue,
+ ISendCounterPacket& sendCounterPacket,
+ const ProfilingStateMachine& profilingStateMachine)
+ : CommandHandlerFunctor(packetId, version)
+ , m_CaptureDataHolder(captureDataHolder)
+ , m_PeriodicCounterCapture(periodicCounterCapture)
+ , m_ReadCounterValues(readCounterValue)
+ , m_SendCounterPacket(sendCounterPacket)
+ , m_StateMachine(profilingStateMachine)
{}
void operator()(const Packet& packet) override;
-
private:
Holder& m_CaptureDataHolder;
- IPeriodicCounterCapture& m_CaptureThread;
+ IPeriodicCounterCapture& m_PeriodicCounterCapture;
+ const IReadCounterValues& m_ReadCounterValues;
ISendCounterPacket& m_SendCounterPacket;
+ const ProfilingStateMachine& m_StateMachine;
+
void ParseData(const Packet& packet, CaptureData& captureData);
};