Skip to content

Commit de5f8df

Browse files
committed
UpdateSampleStatistics() returns if all samples were processed.
This effectively is a check if all frames in a callstack are available.
1 parent 940b598 commit de5f8df

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

‎server/TracyWorker.cpp‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6283,7 +6283,7 @@ void Worker::ReconstructContextSwitchUsage()
62836283
m_data.ctxUsageReady = true;
62846284
}
62856285

6286-
void Worker::UpdateSampleStatistics( uint32_t callstack, uint32_t count, bool canPostpone )
6286+
bool Worker::UpdateSampleStatistics( uint32_t callstack, uint32_t count, bool canPostpone )
62876287
{
62886288
const auto& cs = GetCallstack( callstack );
62896289
const auto cssz = cs.size();
@@ -6306,7 +6306,7 @@ void Worker::UpdateSampleStatistics( uint32_t callstack, uint32_t count, bool ca
63066306
it->second += count;
63076307
}
63086308
}
6309-
return;
6309+
return false;
63106310
}
63116311
else
63126312
{
@@ -6325,6 +6325,7 @@ void Worker::UpdateSampleStatistics( uint32_t callstack, uint32_t count, bool ca
63256325
}
63266326

63276327
UpdateSampleStatisticsImpl( frames, cssz, count, cs );
6328+
return true;
63286329
}
63296330

63306331
void Worker::UpdateSampleStatisticsPostponed( decltype(Worker::DataBlock::postponedSamples.begin())& it )

‎server/TracyWorker.hpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -730,7 +730,7 @@ class Worker
730730

731731
#ifndef TRACY_NO_STATISTICS
732732
void ReconstructContextSwitchUsage();
733-
void UpdateSampleStatistics( uint32_t callstack, uint32_t count, bool canPostpone );
733+
bool UpdateSampleStatistics( uint32_t callstack, uint32_t count, bool canPostpone );
734734
void UpdateSampleStatisticsPostponed( decltype(Worker::DataBlock::postponedSamples.begin())& it );
735735
void UpdateSampleStatisticsImpl( const CallstackFrameData** frames, uint16_t framesCount, uint32_t count, const VarArray<CallstackFrameId>& cs );
736736
#endif

0 commit comments

Comments
 (0)