Keith Davis | 33ed221 | 2020-03-30 10:43:41 +0100 | [diff] [blame] | 1 | // |
Jim Flynn | bbfe603 | 2020-07-20 16:57:44 +0100 | [diff] [blame] | 2 | // Copyright © 2020 Arm Ltd and Contributors. All rights reserved. |
Keith Davis | 33ed221 | 2020-03-30 10:43:41 +0100 | [diff] [blame] | 3 | // SPDX-License-Identifier: MIT |
| 4 | // |
| 5 | |
| 6 | #pragma once |
| 7 | |
Keith Davis | 33ed221 | 2020-03-30 10:43:41 +0100 | [diff] [blame] | 8 | #include "ProfilingStateMachine.hpp" |
Keith Davis | 33ed221 | 2020-03-30 10:43:41 +0100 | [diff] [blame] | 9 | #include "SendTimelinePacket.hpp" |
Keith Davis | 33ed221 | 2020-03-30 10:43:41 +0100 | [diff] [blame] | 10 | #include "INotifyBackends.hpp" |
| 11 | |
Jim Flynn | 2776183 | 2022-03-20 21:52:17 +0000 | [diff] [blame] | 12 | #include <client/include/IReportStructure.hpp> |
| 13 | |
Jim Flynn | bbfe603 | 2020-07-20 16:57:44 +0100 | [diff] [blame] | 14 | #include <common/include/CommandHandlerFunctor.hpp> |
Jim Flynn | decd08b | 2022-03-13 22:35:46 +0000 | [diff] [blame] | 15 | #include <common/include/Optional.hpp> |
Jim Flynn | bbfe603 | 2020-07-20 16:57:44 +0100 | [diff] [blame] | 16 | #include <common/include/Packet.hpp> |
Finn Williams | 0c8cb99 | 2020-05-07 10:38:15 +0100 | [diff] [blame] | 17 | |
Cathal Corbett | 5aa9fd7 | 2022-02-25 15:33:28 +0000 | [diff] [blame] | 18 | namespace arm |
Keith Davis | 33ed221 | 2020-03-30 10:43:41 +0100 | [diff] [blame] | 19 | { |
| 20 | |
Cathal Corbett | 5aa9fd7 | 2022-02-25 15:33:28 +0000 | [diff] [blame] | 21 | namespace pipe |
Keith Davis | 33ed221 | 2020-03-30 10:43:41 +0100 | [diff] [blame] | 22 | { |
| 23 | |
Jim Flynn | bbfe603 | 2020-07-20 16:57:44 +0100 | [diff] [blame] | 24 | class ActivateTimelineReportingCommandHandler : public arm::pipe::CommandHandlerFunctor |
Keith Davis | 33ed221 | 2020-03-30 10:43:41 +0100 | [diff] [blame] | 25 | { |
| 26 | public: |
| 27 | ActivateTimelineReportingCommandHandler(uint32_t familyId, |
| 28 | uint32_t packetId, |
| 29 | uint32_t version, |
| 30 | SendTimelinePacket& sendTimelinePacket, |
| 31 | ProfilingStateMachine& profilingStateMachine, |
Jim Flynn | decd08b | 2022-03-13 22:35:46 +0000 | [diff] [blame] | 32 | arm::pipe::Optional<IReportStructure&> reportStructure, |
Keith Davis | 33ed221 | 2020-03-30 10:43:41 +0100 | [diff] [blame] | 33 | std::atomic<bool>& timelineReporting, |
Jim Flynn | 9c85b41 | 2022-03-16 00:27:43 +0000 | [diff] [blame] | 34 | INotifyBackends& notifyBackends, |
| 35 | IProfilingService& profilingService) |
Keith Davis | 33ed221 | 2020-03-30 10:43:41 +0100 | [diff] [blame] | 36 | : CommandHandlerFunctor(familyId, packetId, version), |
| 37 | m_SendTimelinePacket(sendTimelinePacket), |
| 38 | m_StateMachine(profilingStateMachine), |
| 39 | m_TimelineReporting(timelineReporting), |
| 40 | m_BackendNotifier(notifyBackends), |
Jim Flynn | 9c85b41 | 2022-03-16 00:27:43 +0000 | [diff] [blame] | 41 | m_ProfilingService(profilingService), |
Keith Davis | 33ed221 | 2020-03-30 10:43:41 +0100 | [diff] [blame] | 42 | m_ReportStructure(reportStructure) |
| 43 | {} |
| 44 | |
Jim Flynn | bbfe603 | 2020-07-20 16:57:44 +0100 | [diff] [blame] | 45 | void operator()(const arm::pipe::Packet& packet) override; |
Keith Davis | 33ed221 | 2020-03-30 10:43:41 +0100 | [diff] [blame] | 46 | |
| 47 | private: |
| 48 | SendTimelinePacket& m_SendTimelinePacket; |
| 49 | ProfilingStateMachine& m_StateMachine; |
| 50 | std::atomic<bool>& m_TimelineReporting; |
| 51 | INotifyBackends& m_BackendNotifier; |
Jim Flynn | 9c85b41 | 2022-03-16 00:27:43 +0000 | [diff] [blame] | 52 | IProfilingService& m_ProfilingService; |
Keith Davis | 33ed221 | 2020-03-30 10:43:41 +0100 | [diff] [blame] | 53 | |
Jim Flynn | decd08b | 2022-03-13 22:35:46 +0000 | [diff] [blame] | 54 | arm::pipe::Optional<IReportStructure&> m_ReportStructure; |
Keith Davis | 33ed221 | 2020-03-30 10:43:41 +0100 | [diff] [blame] | 55 | }; |
| 56 | |
Cathal Corbett | 5aa9fd7 | 2022-02-25 15:33:28 +0000 | [diff] [blame] | 57 | } // namespace pipe |
Keith Davis | 33ed221 | 2020-03-30 10:43:41 +0100 | [diff] [blame] | 58 | |
Jim Flynn | 4a96211 | 2022-03-13 20:18:58 +0000 | [diff] [blame] | 59 | } // namespace arm |