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