From 007505067905e02dad76e69b495d63e21fdfa90d Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sat, 6 Nov 2021 19:02:02 +0100 Subject: [PATCH] Allow checking if thread is a fiber. --- server/TracyWorker.cpp | 6 ++++++ server/TracyWorker.hpp | 1 + 2 files changed, 7 insertions(+) diff --git a/server/TracyWorker.cpp b/server/TracyWorker.cpp index 172091da..e1b49b54 100644 --- a/server/TracyWorker.cpp +++ b/server/TracyWorker.cpp @@ -2682,6 +2682,12 @@ bool Worker::IsThreadLocal( uint64_t id ) return td && ( td->count > 0 || !td->samples.empty() ); } +bool Worker::IsThreadFiber( uint64_t id ) +{ + auto td = RetrieveThread( id ); + return td && ( td->isFiber ); +} + const SourceLocation& Worker::GetSourceLocation( int16_t srcloc ) const { if( srcloc < 0 ) diff --git a/server/TracyWorker.hpp b/server/TracyWorker.hpp index 295620f1..9fd4608e 100644 --- a/server/TracyWorker.hpp +++ b/server/TracyWorker.hpp @@ -541,6 +541,7 @@ public: const char* GetString( const StringIdx& idx ) const; const char* GetThreadName( uint64_t id ) const; bool IsThreadLocal( uint64_t id ); + bool IsThreadFiber( uint64_t id ); const SourceLocation& GetSourceLocation( int16_t srcloc ) const; std::pair GetExternalName( uint64_t id ) const;