From e77224975d74d6e868f02712feac3c1622b273d8 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Tue, 26 Mar 2024 20:48:52 +0100 Subject: [PATCH] Update last time when callstack or hw samples arrive. --- server/TracyWorker.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/server/TracyWorker.cpp b/server/TracyWorker.cpp index fc51c06e..7f4bbaee 100644 --- a/server/TracyWorker.cpp +++ b/server/TracyWorker.cpp @@ -6322,6 +6322,7 @@ void Worker::ProcessCallstackSample( const QueueCallstackSample& ev ) const auto refTime = RefTime( m_refTimeCtx, ev.time ); const auto t = refTime == 0 ? 0 : TscTime( refTime ); + if( m_data.lastTime < t ) m_data.lastTime = t; auto& td = *NoticeThread( ev.thread ); @@ -6366,6 +6367,7 @@ void Worker::ProcessCallstackSampleContextSwitch( const QueueCallstackSample& ev const auto refTime = RefTime( m_refTimeCtx, ev.time ); const auto t = refTime == 0 ? 0 : TscTime( refTime ); + if( m_data.lastTime < t ) m_data.lastTime = t; auto& td = *NoticeThread( ev.thread ); @@ -6770,6 +6772,7 @@ void Worker::ProcessTidToPid( const QueueTidToPid& ev ) void Worker::ProcessHwSampleCpuCycle( const QueueHwSample& ev ) { const auto time = ev.time == 0 ? 0 : TscTime( ev.time ); + if( m_data.lastTime < time ) m_data.lastTime = time; auto it = m_data.hwSamples.find( ev.ip ); if( it == m_data.hwSamples.end() ) it = m_data.hwSamples.emplace( ev.ip, HwSampleData {} ).first; it->second.cycles.push_back( time ); @@ -6778,6 +6781,7 @@ void Worker::ProcessHwSampleCpuCycle( const QueueHwSample& ev ) void Worker::ProcessHwSampleInstructionRetired( const QueueHwSample& ev ) { const auto time = ev.time == 0 ? 0 : TscTime( ev.time ); + if( m_data.lastTime < time ) m_data.lastTime = time; auto it = m_data.hwSamples.find( ev.ip ); if( it == m_data.hwSamples.end() ) it = m_data.hwSamples.emplace( ev.ip, HwSampleData {} ).first; it->second.retired.push_back( time ); @@ -6786,6 +6790,7 @@ void Worker::ProcessHwSampleInstructionRetired( const QueueHwSample& ev ) void Worker::ProcessHwSampleCacheReference( const QueueHwSample& ev ) { const auto time = ev.time == 0 ? 0 : TscTime( ev.time ); + if( m_data.lastTime < time ) m_data.lastTime = time; auto it = m_data.hwSamples.find( ev.ip ); if( it == m_data.hwSamples.end() ) it = m_data.hwSamples.emplace( ev.ip, HwSampleData {} ).first; it->second.cacheRef.push_back( time ); @@ -6794,6 +6799,7 @@ void Worker::ProcessHwSampleCacheReference( const QueueHwSample& ev ) void Worker::ProcessHwSampleCacheMiss( const QueueHwSample& ev ) { const auto time = ev.time == 0 ? 0 : TscTime( ev.time ); + if( m_data.lastTime < time ) m_data.lastTime = time; auto it = m_data.hwSamples.find( ev.ip ); if( it == m_data.hwSamples.end() ) it = m_data.hwSamples.emplace( ev.ip, HwSampleData {} ).first; it->second.cacheMiss.push_back( time ); @@ -6802,6 +6808,7 @@ void Worker::ProcessHwSampleCacheMiss( const QueueHwSample& ev ) void Worker::ProcessHwSampleBranchRetired( const QueueHwSample& ev ) { const auto time = ev.time == 0 ? 0 : TscTime( ev.time ); + if( m_data.lastTime < time ) m_data.lastTime = time; auto it = m_data.hwSamples.find( ev.ip ); if( it == m_data.hwSamples.end() ) it = m_data.hwSamples.emplace( ev.ip, HwSampleData {} ).first; it->second.branchRetired.push_back( time ); @@ -6811,6 +6818,7 @@ void Worker::ProcessHwSampleBranchRetired( const QueueHwSample& ev ) void Worker::ProcessHwSampleBranchMiss( const QueueHwSample& ev ) { const auto time = ev.time == 0 ? 0 : TscTime( ev.time ); + if( m_data.lastTime < time ) m_data.lastTime = time; auto it = m_data.hwSamples.find( ev.ip ); if( it == m_data.hwSamples.end() ) it = m_data.hwSamples.emplace( ev.ip, HwSampleData {} ).first; it->second.branchMiss.push_back( time );