Jim Flynn | af94772 | 2022-03-02 11:04:47 +0000 | [diff] [blame] | 1 | // |
| 2 | // Copyright © 2022 Arm Ltd and Contributors. All rights reserved. |
| 3 | // SPDX-License-Identifier: MIT |
| 4 | // |
| 5 | |
| 6 | #include "IProfilingService.hpp" |
| 7 | #include "ProfilingService.hpp" |
| 8 | |
| 9 | namespace arm |
| 10 | { |
| 11 | |
| 12 | namespace pipe |
| 13 | { |
| 14 | |
| 15 | std::unique_ptr<IProfilingService> IProfilingService::CreateProfilingService( |
Jim Flynn | 3443025 | 2022-03-04 15:03:58 +0000 | [diff] [blame] | 16 | uint16_t maxGlobalCounterId, |
| 17 | IInitialiseProfilingService& initialiser, |
Jim Flynn | decd08b | 2022-03-13 22:35:46 +0000 | [diff] [blame] | 18 | arm::pipe::Optional<IReportStructure&> reportStructure) |
Jim Flynn | af94772 | 2022-03-02 11:04:47 +0000 | [diff] [blame] | 19 | { |
Jim Flynn | 3443025 | 2022-03-04 15:03:58 +0000 | [diff] [blame] | 20 | return std::make_unique<ProfilingService>(maxGlobalCounterId, initialiser, reportStructure); |
Jim Flynn | af94772 | 2022-03-02 11:04:47 +0000 | [diff] [blame] | 21 | } |
| 22 | |
| 23 | ProfilingGuidGenerator IProfilingService::m_GuidGenerator; |
| 24 | |
| 25 | ProfilingDynamicGuid IProfilingService::GetNextGuid() |
| 26 | { |
| 27 | return m_GuidGenerator.NextGuid(); |
| 28 | } |
| 29 | |
| 30 | ProfilingStaticGuid IProfilingService::GetStaticId(const std::string& str) |
| 31 | { |
| 32 | return m_GuidGenerator.GenerateStaticId(str); |
| 33 | } |
| 34 | |
| 35 | void IProfilingService::ResetGuidGenerator() |
| 36 | { |
| 37 | m_GuidGenerator.Reset(); |
| 38 | } |
| 39 | |
| 40 | ProfilingDynamicGuid IProfilingService::NextGuid() |
| 41 | { |
| 42 | return IProfilingService::GetNextGuid(); |
| 43 | } |
| 44 | |
| 45 | ProfilingStaticGuid IProfilingService::GenerateStaticId(const std::string& str) |
| 46 | { |
| 47 | return IProfilingService::GetStaticId(str); |
| 48 | } |
| 49 | |
| 50 | } // namespace pipe |
| 51 | } // namespace arm |