mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-26 16:04:34 +00:00
Save/load CPU thread data.
This commit is contained in:
parent
62dbe522c5
commit
3b8518f7b6
@ -449,6 +449,8 @@ struct CpuThreadData
|
||||
uint32_t migrations = 0;
|
||||
};
|
||||
|
||||
enum { CpuThreadDataSize = sizeof( CpuThreadData ) };
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -1517,6 +1517,16 @@ Worker::Worker( FileRead& f, EventType::Type eventMask )
|
||||
f.Read2( tid, pid );
|
||||
m_data.tidToPid.emplace( tid, pid );
|
||||
}
|
||||
|
||||
f.Read( sz );
|
||||
for( uint64_t i=0; i<sz; i++ )
|
||||
{
|
||||
uint64_t tid;
|
||||
CpuThreadData data;
|
||||
f.Read( tid );
|
||||
f.Read( data );
|
||||
m_data.cpuThreadData.emplace( tid, data );
|
||||
}
|
||||
}
|
||||
|
||||
s_loadProgress.total.store( 0, std::memory_order_relaxed );
|
||||
@ -5093,6 +5103,14 @@ void Worker::Write( FileWrite& f )
|
||||
f.Write( &v.first, sizeof( v.first ) );
|
||||
f.Write( &v.second, sizeof( v.second ) );
|
||||
}
|
||||
|
||||
sz = m_data.cpuThreadData.size();
|
||||
f.Write( &sz, sizeof( sz ) );
|
||||
for( auto& v : m_data.cpuThreadData )
|
||||
{
|
||||
f.Write( &v.first, sizeof( v.first ) );
|
||||
f.Write( &v.second, sizeof( v.second ) );
|
||||
}
|
||||
}
|
||||
|
||||
void Worker::WriteTimeline( FileWrite& f, const Vector<ZoneEvent*>& vec, int64_t& refTime )
|
||||
|
Loading…
Reference in New Issue
Block a user