From 8f44f1c68bd9a43e89e04583ff80941e241a65e1 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Tue, 2 Nov 2021 01:45:01 +0100 Subject: [PATCH] Store fiber state is ThreadData. --- server/TracyEvent.hpp | 1 + server/TracyWorker.cpp | 7 ++++--- server/TracyWorker.hpp | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/server/TracyEvent.hpp b/server/TracyEvent.hpp index 104e3f13..34186c72 100644 --- a/server/TracyEvent.hpp +++ b/server/TracyEvent.hpp @@ -666,6 +666,7 @@ struct ThreadData Vector samples; SampleData pendingSample; uint64_t kernelSampleCnt; + uint8_t isFiber; tracy_force_inline void IncStackCount( int16_t srcloc ) { IncSrcLocCount( stackCount, srcloc ); } tracy_force_inline bool DecStackCount( int16_t srcloc ) { return DecSrcLocCount( stackCount, srcloc ); } diff --git a/server/TracyWorker.cpp b/server/TracyWorker.cpp index 8d0d0a71..63690f3b 100644 --- a/server/TracyWorker.cpp +++ b/server/TracyWorker.cpp @@ -3561,7 +3561,7 @@ ThreadData* Worker::NoticeThreadReal( uint64_t thread ) } else { - return NewThread( thread ); + return NewThread( thread, false ); } } @@ -3614,9 +3614,9 @@ const MemData& Worker::GetMemoryNamed( uint64_t name ) const return *it->second; } -ThreadData* Worker::NewThread( uint64_t thread ) +ThreadData* Worker::NewThread( uint64_t thread, bool fiber ) { - CheckThreadString( thread ); + if( !fiber ) CheckThreadString( thread ); auto td = m_slab.AllocInit(); td->id = thread; td->count = 0; @@ -3626,6 +3626,7 @@ ThreadData* Worker::NewThread( uint64_t thread ) #endif td->kernelSampleCnt = 0; td->pendingSample.time.Clear(); + td->isFiber = fiber; m_data.threads.push_back( td ); m_threadMap.emplace( thread, td ); m_data.threadDataLast.first = thread; diff --git a/server/TracyWorker.hpp b/server/TracyWorker.hpp index c60b0211..e4532710 100644 --- a/server/TracyWorker.hpp +++ b/server/TracyWorker.hpp @@ -743,7 +743,7 @@ private: void InsertMessageData( MessageData* msg ); ThreadData* NoticeThreadReal( uint64_t thread ); - ThreadData* NewThread( uint64_t thread ); + ThreadData* NewThread( uint64_t thread, bool fiber ); tracy_force_inline ThreadData* NoticeThread( uint64_t thread ) { if( m_data.threadDataLast.first == thread ) return m_data.threadDataLast.second;