diff options
author | Jim Flynn <jim.flynn@arm.com> | 2020-02-14 10:18:08 +0000 |
---|---|---|
committer | Jim Flynn <jim.flynn@arm.com> | 2020-02-16 13:37:52 +0000 |
commit | 640635528c5236458a05f970391894adf0a515d0 (patch) | |
tree | 0559eb6e0b2b34f6a314f2cc79acb8b3e189467a /src/profiling/backends/BackendProfiling.cpp | |
parent | a856501ac5c2d0cca70068993e5c7cc714872890 (diff) | |
download | armnn-640635528c5236458a05f970391894adf0a515d0.tar.gz |
IVGCVSW-4320 Implement ReportCounters in BackendProfiling
Change-Id: Idd545079f6331bb4241709fa1534635f3fdf610b
Signed-off-by: Jim Flynn <jim.flynn@arm.com>
Diffstat (limited to 'src/profiling/backends/BackendProfiling.cpp')
-rw-r--r-- | src/profiling/backends/BackendProfiling.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/profiling/backends/BackendProfiling.cpp b/src/profiling/backends/BackendProfiling.cpp index 884fb3f2ff..0926879f67 100644 --- a/src/profiling/backends/BackendProfiling.cpp +++ b/src/profiling/backends/BackendProfiling.cpp @@ -29,6 +29,24 @@ IProfilingGuidGenerator& BackendProfiling::GetProfilingGuidGenerator() return m_ProfilingService; } +void BackendProfiling::ReportCounters(const std::vector<Timestamp>& timestamps) +{ + for (const auto timestampInfo : timestamps) + { + std::vector<CounterValue> backendCounterValues = timestampInfo.counterValues; + for_each(backendCounterValues.begin(), backendCounterValues.end(), [&](CounterValue& backendCounterValue) + { + // translate the counterId to globalCounterId + backendCounterValue.counterId = m_ProfilingService.GetCounterMappings().GetGlobalId( + backendCounterValue.counterId, m_BackendId); + }); + + // Send Periodic Counter Capture Packet for the Timestamp + m_ProfilingService.GetSendCounterPacket().SendPeriodicCounterCapturePacket( + timestampInfo.timestamp, backendCounterValues); + } +} + CounterStatus BackendProfiling::GetCounterStatus(uint16_t backendCounterId) { uint16_t globalCounterId = m_ProfilingService.GetCounterMappings().GetGlobalId(backendCounterId, m_BackendId); |