From 691fe06bfe9c29e79ef9d051dd5945e9137c35f9 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sun, 18 Aug 2019 14:40:04 +0200 Subject: [PATCH] Compare pids to determine if thread is local untracked. --- server/TracyView.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 3aca0aa6..095252af 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -3994,7 +3994,19 @@ int View::DrawCpuData( int offset, double pxns, const ImVec2& wpos, bool hover, const auto thread = it->Thread(); const auto local = m_worker.IsThreadLocal( thread ); auto txt = local ? m_worker.GetThreadString( thread ) : m_worker.GetExternalName( thread ).first; - const bool untracked = !local && strcmp( txt, m_worker.GetCaptureProgram().c_str() ) == 0; + bool untracked = false; + if( !local ) + { + if( m_worker.GetPid() == 0 ) + { + untracked = strcmp( txt, m_worker.GetCaptureProgram().c_str() ) == 0; + } + else + { + const auto pid = m_worker.GetPidFromTid( thread ); + untracked = pid == m_worker.GetPid(); + } + } const auto pr0 = ( start - m_zvStart ) * pxns; const auto pr1 = ( end - m_zvStart ) * pxns; const auto px0 = std::max( pr0, -10.0 );