From 5dc816e7d027170992e45d22ae11ae3000de9244 Mon Sep 17 00:00:00 2001 From: Matteo Martincigh Date: Mon, 4 Nov 2019 14:05:28 +0000 Subject: IVGCVSW-4065 Add a RecordEvent function * Added RecordEvent utility function to the TimelineUtilityMethods class * Added new utility function to get a timestamp * Added unit tests Signed-off-by: Matteo Martincigh Change-Id: Ia3f8fe7397915fa6c903ce0c0abab3047cea628c --- src/profiling/PeriodicCounterCapture.cpp | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'src/profiling/PeriodicCounterCapture.cpp') diff --git a/src/profiling/PeriodicCounterCapture.cpp b/src/profiling/PeriodicCounterCapture.cpp index f888bc045e..12e58f2800 100644 --- a/src/profiling/PeriodicCounterCapture.cpp +++ b/src/profiling/PeriodicCounterCapture.cpp @@ -92,18 +92,11 @@ void PeriodicCounterCapture::Capture(const IReadCounterValues& readCounterValues values.emplace_back(std::make_pair(requestedId, counterValue)); } - #if USE_CLOCK_MONOTONIC_RAW - using clock = MonotonicClockRaw; - #else - using clock = std::chrono::steady_clock; - #endif - // Take a timestamp - auto timestamp = clock::now(); + uint64_t timestamp = GetTimestamp(); // Write a Periodic Counter Capture packet to the Counter Stream Buffer - m_SendCounterPacket.SendPeriodicCounterCapturePacket( - static_cast(timestamp.time_since_epoch().count()), values); + m_SendCounterPacket.SendPeriodicCounterCapturePacket(timestamp, values); // Notify the Send Thread that new data is available in the Counter Stream Buffer m_SendCounterPacket.SetReadyToRead(); -- cgit v1.2.1