blob: 8ca88d20120090df352afa6dbeb1ba9368f962d2 [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
Sadik Armagan3184c902020-03-18 10:57:30 +00008#include "ProfilingService.hpp"
Jim Flynn27761832022-03-20 21:52:17 +00009
10#include <client/include/backends/IBackendProfiling.hpp>
Colm Donelan1aff3932020-02-05 17:48:59 +000011
Cathal Corbett5aa9fd72022-02-25 15:33:28 +000012namespace arm
Colm Donelan1aff3932020-02-05 17:48:59 +000013{
14
Cathal Corbett5aa9fd72022-02-25 15:33:28 +000015namespace pipe
Colm Donelan1aff3932020-02-05 17:48:59 +000016{
17
18class BackendProfiling : public IBackendProfiling
19{
20public:
Jim Flynn4c9ed1d2022-01-23 23:57:20 +000021 BackendProfiling(const ProfilingOptions& options,
Jim Flynnaf947722022-03-02 11:04:47 +000022 IProfilingService& profilingService,
Cathal Corbett6f073722022-03-04 12:11:09 +000023 const std::string& backendId)
James Conroy2dcd3fe2020-02-06 18:34:52 +000024 : m_Options(options),
25 m_ProfilingService(profilingService),
26 m_BackendId(backendId) {}
Colm Donelan1aff3932020-02-05 17:48:59 +000027
28 ~BackendProfiling()
29 {}
30
31 std::unique_ptr<IRegisterBackendCounters>
James Conroy2dcd3fe2020-02-06 18:34:52 +000032 GetCounterRegistrationInterface(uint16_t currentMaxGlobalCounterID) override;
Colm Donelan1aff3932020-02-05 17:48:59 +000033
34 std::unique_ptr<ISendTimelinePacket> GetSendTimelinePacket() override;
35
36 IProfilingGuidGenerator& GetProfilingGuidGenerator() override;
37
Jim Flynn64063552020-02-14 10:18:08 +000038 void ReportCounters(const std::vector<Timestamp>&) override;
Colm Donelan1aff3932020-02-05 17:48:59 +000039
40 CounterStatus GetCounterStatus(uint16_t backendCounterId) override;
41
42 std::vector<CounterStatus> GetActiveCounters() override;
43
44 bool IsProfilingEnabled() const override;
45
46private:
Jim Flynn4c9ed1d2022-01-23 23:57:20 +000047 ProfilingOptions m_Options;
Jim Flynnaf947722022-03-02 11:04:47 +000048 IProfilingService& m_ProfilingService;
Cathal Corbett6f073722022-03-04 12:11:09 +000049 std::string m_BackendId;
Colm Donelan1aff3932020-02-05 17:48:59 +000050};
Cathal Corbett5aa9fd72022-02-25 15:33:28 +000051
52} // namespace pipe
53
54} // namespace arm