blob: a40115084b38481bf288bacc1e6b025eedefce93 [file] [log] [blame]
Keith Davis33ed2212020-03-30 10:43:41 +01001//
Jim Flynnbbfe6032020-07-20 16:57:44 +01002// Copyright © 2020 Arm Ltd and Contributors. All rights reserved.
Keith Davis33ed2212020-03-30 10:43:41 +01003// SPDX-License-Identifier: MIT
4//
5
6#pragma once
7
Keith Davis33ed2212020-03-30 10:43:41 +01008#include "ProfilingStateMachine.hpp"
Keith Davis33ed2212020-03-30 10:43:41 +01009#include "SendTimelinePacket.hpp"
10#include "IReportStructure.hpp"
Keith Davis33ed2212020-03-30 10:43:41 +010011#include "INotifyBackends.hpp"
12
Finn Williams0c8cb992020-05-07 10:38:15 +010013#include "armnn/Optional.hpp"
14
Jim Flynnbbfe6032020-07-20 16:57:44 +010015#include <common/include/CommandHandlerFunctor.hpp>
16#include <common/include/Packet.hpp>
Finn Williams0c8cb992020-05-07 10:38:15 +010017
18
Keith Davis33ed2212020-03-30 10:43:41 +010019namespace armnn
20{
21
22namespace profiling
23{
24
Jim Flynnbbfe6032020-07-20 16:57:44 +010025class ActivateTimelineReportingCommandHandler : public arm::pipe::CommandHandlerFunctor
Keith Davis33ed2212020-03-30 10:43:41 +010026{
27public:
28 ActivateTimelineReportingCommandHandler(uint32_t familyId,
29 uint32_t packetId,
30 uint32_t version,
31 SendTimelinePacket& sendTimelinePacket,
32 ProfilingStateMachine& profilingStateMachine,
33 Optional<IReportStructure&> reportStructure,
34 std::atomic<bool>& timelineReporting,
35 INotifyBackends& notifyBackends)
36 : CommandHandlerFunctor(familyId, packetId, version),
37 m_SendTimelinePacket(sendTimelinePacket),
38 m_StateMachine(profilingStateMachine),
39 m_TimelineReporting(timelineReporting),
40 m_BackendNotifier(notifyBackends),
41 m_ReportStructure(reportStructure)
42 {}
43
Jim Flynnbbfe6032020-07-20 16:57:44 +010044 void operator()(const arm::pipe::Packet& packet) override;
Keith Davis33ed2212020-03-30 10:43:41 +010045
46private:
47 SendTimelinePacket& m_SendTimelinePacket;
48 ProfilingStateMachine& m_StateMachine;
49 std::atomic<bool>& m_TimelineReporting;
50 INotifyBackends& m_BackendNotifier;
51
52 Optional<IReportStructure&> m_ReportStructure;
53};
54
55} // namespace profiling
56
57} // namespace armnn