mirror of
https://github.com/wolfpld/tracy.git
synced 2025-03-20 07:40:02 +08:00
Create tid to pid mapping.
This commit is contained in:
@@ -3085,6 +3085,9 @@ bool Worker::Process( const QueueItem& ev )
|
||||
case QueueType::ThreadWakeup:
|
||||
ProcessThreadWakeup( ev.threadWakeup );
|
||||
break;
|
||||
case QueueType::TidToPid:
|
||||
ProcessTidToPid( ev.tidToPid );
|
||||
break;
|
||||
default:
|
||||
assert( false );
|
||||
break;
|
||||
@@ -4194,6 +4197,12 @@ void Worker::ProcessThreadWakeup( const QueueThreadWakeup& ev )
|
||||
item.SetState( -1 );
|
||||
}
|
||||
|
||||
void Worker::ProcessTidToPid( const QueueTidToPid& ev )
|
||||
{
|
||||
assert( m_data.tidToPid.find( ev.tid ) == m_data.tidToPid.end() );
|
||||
m_data.tidToPid.emplace( ev.tid, ev.pid );
|
||||
}
|
||||
|
||||
void Worker::MemAllocChanged( int64_t time )
|
||||
{
|
||||
const auto val = (double)m_data.memory.usage;
|
||||
|
||||
@@ -212,6 +212,7 @@ private:
|
||||
std::pair<uint64_t, ContextSwitch*> ctxSwitchLast;
|
||||
|
||||
CpuData cpuData[256];
|
||||
flat_hash_map<uint64_t, uint64_t, nohash<uint64_t>> tidToPid;
|
||||
};
|
||||
|
||||
struct MbpsBlock
|
||||
@@ -442,6 +443,7 @@ private:
|
||||
tracy_force_inline void ProcessSysTime( const QueueSysTime& ev );
|
||||
tracy_force_inline void ProcessContextSwitch( const QueueContextSwitch& ev );
|
||||
tracy_force_inline void ProcessThreadWakeup( const QueueThreadWakeup& ev );
|
||||
tracy_force_inline void ProcessTidToPid( const QueueTidToPid& ev );
|
||||
|
||||
tracy_force_inline void ProcessZoneBeginImpl( ZoneEvent* zone, const QueueZoneBegin& ev );
|
||||
tracy_force_inline void ProcessZoneBeginAllocSrcLocImpl( ZoneEvent* zone, const QueueZoneBegin& ev );
|
||||
|
||||
Reference in New Issue
Block a user