1
0
mirror of https://github.com/wolfpld/tracy synced 2025-04-29 20:33:52 +00:00

Store fiber state is ThreadData.

This commit is contained in:
Bartosz Taudul 2021-11-02 01:45:01 +01:00
parent 229d547e91
commit 8f44f1c68b
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3
3 changed files with 6 additions and 4 deletions

View File

@ -666,6 +666,7 @@ struct ThreadData
Vector<SampleData> samples; Vector<SampleData> samples;
SampleData pendingSample; SampleData pendingSample;
uint64_t kernelSampleCnt; uint64_t kernelSampleCnt;
uint8_t isFiber;
tracy_force_inline void IncStackCount( int16_t srcloc ) { IncSrcLocCount( stackCount, srcloc ); } tracy_force_inline void IncStackCount( int16_t srcloc ) { IncSrcLocCount( stackCount, srcloc ); }
tracy_force_inline bool DecStackCount( int16_t srcloc ) { return DecSrcLocCount( stackCount, srcloc ); } tracy_force_inline bool DecStackCount( int16_t srcloc ) { return DecSrcLocCount( stackCount, srcloc ); }

View File

@ -3561,7 +3561,7 @@ ThreadData* Worker::NoticeThreadReal( uint64_t thread )
} }
else else
{ {
return NewThread( thread ); return NewThread( thread, false );
} }
} }
@ -3614,9 +3614,9 @@ const MemData& Worker::GetMemoryNamed( uint64_t name ) const
return *it->second; 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<ThreadData>(); auto td = m_slab.AllocInit<ThreadData>();
td->id = thread; td->id = thread;
td->count = 0; td->count = 0;
@ -3626,6 +3626,7 @@ ThreadData* Worker::NewThread( uint64_t thread )
#endif #endif
td->kernelSampleCnt = 0; td->kernelSampleCnt = 0;
td->pendingSample.time.Clear(); td->pendingSample.time.Clear();
td->isFiber = fiber;
m_data.threads.push_back( td ); m_data.threads.push_back( td );
m_threadMap.emplace( thread, td ); m_threadMap.emplace( thread, td );
m_data.threadDataLast.first = thread; m_data.threadDataLast.first = thread;

View File

@ -743,7 +743,7 @@ private:
void InsertMessageData( MessageData* msg ); void InsertMessageData( MessageData* msg );
ThreadData* NoticeThreadReal( uint64_t thread ); 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 ) tracy_force_inline ThreadData* NoticeThread( uint64_t thread )
{ {
if( m_data.threadDataLast.first == thread ) return m_data.threadDataLast.second; if( m_data.threadDataLast.first == thread ) return m_data.threadDataLast.second;