blob: 4db02f9573b9b77c6eadbd9ae8e0a486b97211c3 [file] [log] [blame]
Colm Donelan1aff3932020-02-05 17:48:59 +00001//
2// Copyright © 2020 Arm Ltd. All rights reserved.
3// SPDX-License-Identifier: MIT
4//
5
James Conroy2dcd3fe2020-02-06 18:34:52 +00006#pragma once
7
Jim Flynn27761832022-03-20 21:52:17 +00008#include <client/include/backends/IBackendProfiling.hpp>
Jim Flynn3e9bc192022-03-23 23:01:26 +00009#include <client/include/IProfilingService.hpp>
Colm Donelan1aff3932020-02-05 17:48:59 +000010
Cathal Corbett5aa9fd72022-02-25 15:33:28 +000011namespace arm
Colm Donelan1aff3932020-02-05 17:48:59 +000012{
13
Cathal Corbett5aa9fd72022-02-25 15:33:28 +000014namespace pipe
Colm Donelan1aff3932020-02-05 17:48:59 +000015{
16
17class BackendProfiling : public IBackendProfiling
18{
19public:
Jim Flynn4c9ed1d2022-01-23 23:57:20 +000020 BackendProfiling(const ProfilingOptions& options,
Jim Flynnaf947722022-03-02 11:04:47 +000021 IProfilingService& profilingService,
Cathal Corbett6f073722022-03-04 12:11:09 +000022 const std::string& backendId)
James Conroy2dcd3fe2020-02-06 18:34:52 +000023 : m_Options(options),
24 m_ProfilingService(profilingService),
25 m_BackendId(backendId) {}
Colm Donelan1aff3932020-02-05 17:48:59 +000026
27 ~BackendProfiling()
28 {}
29
30 std::unique_ptr<IRegisterBackendCounters>
James Conroy2dcd3fe2020-02-06 18:34:52 +000031 GetCounterRegistrationInterface(uint16_t currentMaxGlobalCounterID) override;
Colm Donelan1aff3932020-02-05 17:48:59 +000032
33 std::unique_ptr<ISendTimelinePacket> GetSendTimelinePacket() override;
34
35 IProfilingGuidGenerator& GetProfilingGuidGenerator() override;
36
Jim Flynn64063552020-02-14 10:18:08 +000037 void ReportCounters(const std::vector<Timestamp>&) override;
Colm Donelan1aff3932020-02-05 17:48:59 +000038
39 CounterStatus GetCounterStatus(uint16_t backendCounterId) override;
40
41 std::vector<CounterStatus> GetActiveCounters() override;
42
43 bool IsProfilingEnabled() const override;
44
45private:
Jim Flynn4c9ed1d2022-01-23 23:57:20 +000046 ProfilingOptions m_Options;
Jim Flynnaf947722022-03-02 11:04:47 +000047 IProfilingService& m_ProfilingService;
Cathal Corbett6f073722022-03-04 12:11:09 +000048 std::string m_BackendId;
Colm Donelan1aff3932020-02-05 17:48:59 +000049};
Cathal Corbett5aa9fd72022-02-25 15:33:28 +000050
51} // namespace pipe
52
53} // namespace arm