From c212661714c1a788883c1b45dcf1a439c84bb2d4 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Fri, 16 Aug 2019 17:59:25 +0200 Subject: [PATCH] Allow determining whether thread is local to profiled program. --- server/TracyWorker.cpp | 5 +++++ server/TracyWorker.hpp | 1 + 2 files changed, 6 insertions(+) diff --git a/server/TracyWorker.cpp b/server/TracyWorker.cpp index c8472c53..19cedb9b 100644 --- a/server/TracyWorker.cpp +++ b/server/TracyWorker.cpp @@ -1819,6 +1819,11 @@ const char* Worker::GetThreadString( uint64_t id ) const } } +bool Worker::IsThreadLocal( uint64_t id ) const +{ + return m_data.threadMap.find( id ) != m_data.threadMap.end(); +} + const SourceLocation& Worker::GetSourceLocation( int16_t srcloc ) const { if( srcloc < 0 ) diff --git a/server/TracyWorker.hpp b/server/TracyWorker.hpp index 46f0429b..530b190f 100644 --- a/server/TracyWorker.hpp +++ b/server/TracyWorker.hpp @@ -332,6 +332,7 @@ public: const char* GetString( const StringRef& ref ) const; const char* GetString( const StringIdx& idx ) const; const char* GetThreadString( uint64_t id ) const; + bool IsThreadLocal( uint64_t id ) const; const SourceLocation& GetSourceLocation( int16_t srcloc ) const; const char* GetZoneName( const SourceLocation& srcloc ) const;