mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-26 16:04:34 +00:00
Threads may be mapped to fibers.
This commit is contained in:
parent
0718330016
commit
d522af99b9
@ -3558,31 +3558,55 @@ void Worker::InsertMessageData( MessageData* msg )
|
|||||||
|
|
||||||
ThreadData* Worker::NoticeThreadReal( uint64_t thread )
|
ThreadData* Worker::NoticeThreadReal( uint64_t thread )
|
||||||
{
|
{
|
||||||
auto it = m_threadMap.find( thread );
|
auto fit = m_data.threadToFiberMap.find( thread );
|
||||||
if( it != m_threadMap.end() )
|
if( fit == m_data.threadToFiberMap.end() )
|
||||||
{
|
{
|
||||||
m_data.threadDataLast.first = thread;
|
auto it = m_threadMap.find( thread );
|
||||||
m_data.threadDataLast.second = it->second;
|
if( it != m_threadMap.end() )
|
||||||
return it->second;
|
{
|
||||||
|
m_data.threadDataLast.first = thread;
|
||||||
|
m_data.threadDataLast.second = it->second;
|
||||||
|
return it->second;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return NewThread( thread, false );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return NewThread( thread, false );
|
auto it = m_threadMap.find( fit->second );
|
||||||
|
assert( it != m_threadMap.end() );
|
||||||
|
m_data.threadDataLast.first = thread;
|
||||||
|
m_data.threadDataLast.second = it->second;
|
||||||
|
return it->second;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ThreadData* Worker::RetrieveThreadReal( uint64_t thread )
|
ThreadData* Worker::RetrieveThreadReal( uint64_t thread )
|
||||||
{
|
{
|
||||||
auto it = m_threadMap.find( thread );
|
auto fit = m_data.threadToFiberMap.find( thread );
|
||||||
if( it != m_threadMap.end() )
|
if( fit == m_data.threadToFiberMap.end() )
|
||||||
{
|
{
|
||||||
m_data.threadDataLast.first = thread;
|
auto it = m_threadMap.find( thread );
|
||||||
m_data.threadDataLast.second = it->second;
|
if( it != m_threadMap.end() )
|
||||||
return it->second;
|
{
|
||||||
|
m_data.threadDataLast.first = thread;
|
||||||
|
m_data.threadDataLast.second = it->second;
|
||||||
|
return it->second;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return nullptr;
|
auto it = m_threadMap.find( fit->second );
|
||||||
|
assert( it != m_threadMap.end() );
|
||||||
|
m_data.threadDataLast.first = thread;
|
||||||
|
m_data.threadDataLast.second = it->second;
|
||||||
|
return it->second;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -363,6 +363,8 @@ private:
|
|||||||
unordered_flat_map<const char*, MemoryBlock, charutil::Hasher, charutil::Comparator> sourceFileCache;
|
unordered_flat_map<const char*, MemoryBlock, charutil::Hasher, charutil::Comparator> sourceFileCache;
|
||||||
|
|
||||||
unordered_flat_map<uint64_t, HwSampleData> hwSamples;
|
unordered_flat_map<uint64_t, HwSampleData> hwSamples;
|
||||||
|
|
||||||
|
unordered_flat_map<uint64_t, uint64_t> threadToFiberMap;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct MbpsBlock
|
struct MbpsBlock
|
||||||
|
Loading…
Reference in New Issue
Block a user