From eb48d24182847948ddbcf7a353f28c59ee65243b Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Mon, 30 Mar 2020 23:41:21 +0200 Subject: [PATCH] Store context switch data for threads with ghost zones. --- server/TracyWorker.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/server/TracyWorker.cpp b/server/TracyWorker.cpp index b321783e..607d0282 100644 --- a/server/TracyWorker.cpp +++ b/server/TracyWorker.cpp @@ -2434,7 +2434,8 @@ const char* Worker::GetThreadName( uint64_t id ) const bool Worker::IsThreadLocal( uint64_t id ) { - return m_data.localThreadCompress.Exists( id ) && RetrieveThread( id )->count > 0; + auto td = RetrieveThread( id ); + return td && ( td->count > 0 || !td->ghostZones.empty() ); } const SourceLocation& Worker::GetSourceLocation( int16_t srcloc ) const @@ -6775,7 +6776,8 @@ void Worker::Write( FileWrite& f ) ctxValid.reserve( m_data.ctxSwitch.size() ); for( auto it = m_data.ctxSwitch.begin(); it != m_data.ctxSwitch.end(); ++it ) { - if( m_data.localThreadCompress.Exists( it->first ) ) + auto td = RetrieveThread( it->first ); + if( td && ( td->count > 0 || !td->ghostZones.empty() ) ) { ctxValid.emplace_back( it ); }