blob: ecc7076810e414a9ce3d28134a913e9abab544a1 [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
Cathal Corbett5aa9fd72022-02-25 15:33:28 +000019namespace arm
Keith Davis33ed2212020-03-30 10:43:41 +010020{
21
Cathal Corbett5aa9fd72022-02-25 15:33:28 +000022namespace pipe
Keith Davis33ed2212020-03-30 10:43:41 +010023{
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,
Cathal Corbett5aa9fd72022-02-25 15:33:28 +000033 armnn::Optional<IReportStructure&> reportStructure,
Keith Davis33ed2212020-03-30 10:43:41 +010034 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
Cathal Corbett5aa9fd72022-02-25 15:33:28 +000052 armnn::Optional<IReportStructure&> m_ReportStructure;
Keith Davis33ed2212020-03-30 10:43:41 +010053};
54
Cathal Corbett5aa9fd72022-02-25 15:33:28 +000055} // namespace pipe
Keith Davis33ed2212020-03-30 10:43:41 +010056
Jim Flynn4a962112022-03-13 20:18:58 +000057} // namespace arm