From 01d0281404183c84d26e863502cac8d83044c0bf Mon Sep 17 00:00:00 2001 From: Jim Flynn Date: Wed, 29 Apr 2020 21:12:13 +0100 Subject: IVGCVSW-4595 Change FileOnlyProfilingConnection to all packet processor model Change-Id: Ieccb26190d80e570ddef8d7c22e824eda1b92d7f Signed-off-by: Jim Flynn --- .../test/RequestCountersPacketHandler.hpp | 47 ++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 src/profiling/test/RequestCountersPacketHandler.hpp (limited to 'src/profiling/test/RequestCountersPacketHandler.hpp') diff --git a/src/profiling/test/RequestCountersPacketHandler.hpp b/src/profiling/test/RequestCountersPacketHandler.hpp new file mode 100644 index 0000000000..203edcc9df --- /dev/null +++ b/src/profiling/test/RequestCountersPacketHandler.hpp @@ -0,0 +1,47 @@ +// +// Copyright © 2020 Arm Ltd. All rights reserved. +// SPDX-License-Identifier: MIT +// + +#pragma once + +#include +#include +#include "Packet.hpp" +#include "ProfilingUtils.hpp" + +namespace armnn +{ + +namespace profiling +{ + +class RequestCountersPacketHandler : public ILocalPacketHandler +{ +public: + explicit RequestCountersPacketHandler(uint32_t capturePeriod = LOWEST_CAPTURE_PERIOD) : + m_CapturePeriod(capturePeriod), + m_Connection(nullptr), + m_CounterDirectoryMessageHeader(ConstructHeader(0, 2)) {} + + std::vector GetHeadersAccepted() override; // ILocalPacketHandler + + void HandlePacket(const Packet& packet) override; // ILocalPacketHandler + + void SetConnection(IInternalProfilingConnection* profilingConnection) override // ILocalPacketHandler + { + m_Connection = profilingConnection; + } + +private: + uint32_t m_CapturePeriod; + IInternalProfilingConnection* m_Connection; + uint32_t m_CounterDirectoryMessageHeader; + std::vector m_IdList; + + void SendCounterSelectionPacket(); +}; + +} // namespace profiling + +} // namespace armnn \ No newline at end of file -- cgit v1.2.1