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 | 9c85b41 | 2022-03-16 00:27:43 +0000 | [diff] [blame^] | 18 | const std::string& softwareInfo, |
| 19 | const std::string& softwareVersion, |
| 20 | const std::string& hardwareVersion, |
Jim Flynn | decd08b | 2022-03-13 22:35:46 +0000 | [diff] [blame] | 21 | arm::pipe::Optional<IReportStructure&> reportStructure) |
Jim Flynn | af94772 | 2022-03-02 11:04:47 +0000 | [diff] [blame] | 22 | { |
Jim Flynn | 9c85b41 | 2022-03-16 00:27:43 +0000 | [diff] [blame^] | 23 | return std::make_unique<ProfilingService>(maxGlobalCounterId, |
| 24 | initialiser, |
| 25 | softwareInfo, |
| 26 | softwareVersion, |
| 27 | hardwareVersion, |
| 28 | reportStructure); |
Jim Flynn | af94772 | 2022-03-02 11:04:47 +0000 | [diff] [blame] | 29 | } |
| 30 | |
| 31 | ProfilingGuidGenerator IProfilingService::m_GuidGenerator; |
| 32 | |
| 33 | ProfilingDynamicGuid IProfilingService::GetNextGuid() |
| 34 | { |
| 35 | return m_GuidGenerator.NextGuid(); |
| 36 | } |
| 37 | |
| 38 | ProfilingStaticGuid IProfilingService::GetStaticId(const std::string& str) |
| 39 | { |
| 40 | return m_GuidGenerator.GenerateStaticId(str); |
| 41 | } |
| 42 | |
| 43 | void IProfilingService::ResetGuidGenerator() |
| 44 | { |
| 45 | m_GuidGenerator.Reset(); |
| 46 | } |
| 47 | |
| 48 | ProfilingDynamicGuid IProfilingService::NextGuid() |
| 49 | { |
| 50 | return IProfilingService::GetNextGuid(); |
| 51 | } |
| 52 | |
| 53 | ProfilingStaticGuid IProfilingService::GenerateStaticId(const std::string& str) |
| 54 | { |
| 55 | return IProfilingService::GetStaticId(str); |
| 56 | } |
| 57 | |
| 58 | } // namespace pipe |
| 59 | } // namespace arm |