diff --git a/server/TracyView.cpp b/server/TracyView.cpp index ab5e7a33..2bf87ae7 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -6354,7 +6354,7 @@ void View::DrawInfo() TextFocused( "Call stacks:", RealToString( m_worker.GetCallstackPayloadCount(), true ) ); TextFocused( "Call stack frames:", RealToString( m_worker.GetCallstackFrameCount(), true ) ); - const auto fsz = m_worker.GetFrameCount( *m_frames ) - 1; + const auto fsz = m_worker.GetFullFrameCount( *m_frames ); if( fsz != 0 ) { if( m_frameSortData.frameSet != m_frames || m_frameSortData.frameNum != fsz ) diff --git a/server/TracyWorker.cpp b/server/TracyWorker.cpp index 1f586481..88d94435 100644 --- a/server/TracyWorker.cpp +++ b/server/TracyWorker.cpp @@ -953,6 +953,36 @@ uint64_t Worker::GetPlotCount() const return cnt; } +size_t Worker::GetFullFrameCount( const FrameData& fd ) const +{ + const auto sz = fd.frames.size(); + assert( sz != 0 ); + + if( fd.continuous ) + { + if( IsConnected() ) + { + return sz - 1; + } + else + { + return sz; + } + } + else + { + const auto& last = fd.frames.back(); + if( last.end >= 0 ) + { + return sz; + } + else + { + return sz - 1; + } + } +} + int64_t Worker::GetFrameTime( const FrameData& fd, size_t idx ) const { if( fd.continuous ) diff --git a/server/TracyWorker.hpp b/server/TracyWorker.hpp index d35c0e7f..65923de3 100644 --- a/server/TracyWorker.hpp +++ b/server/TracyWorker.hpp @@ -185,6 +185,7 @@ public: TracyMutex& GetDataLock() { return m_data.lock; } size_t GetFrameCount( const FrameData& fd ) const { return fd.frames.size(); } + size_t GetFullFrameCount( const FrameData& fd ) const; int64_t GetTimeBegin() const { return GetFrameBegin( *m_data.framesBase, 0 ); } int64_t GetLastTime() const { return m_data.lastTime; } uint64_t GetZoneCount() const { return m_data.zonesCnt; }