mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-27 00:04:35 +00:00
Save/load sampling period.
This commit is contained in:
parent
af58649113
commit
d6c0720f8a
@ -258,6 +258,7 @@ Worker::Worker( const std::string& program, const std::vector<ImportEventTimelin
|
|||||||
, m_captureProgram( program )
|
, m_captureProgram( program )
|
||||||
, m_captureTime( 0 )
|
, m_captureTime( 0 )
|
||||||
, m_pid( 0 )
|
, m_pid( 0 )
|
||||||
|
, m_samplingPeriod( 0 )
|
||||||
, m_stream( nullptr )
|
, m_stream( nullptr )
|
||||||
, m_buffer( nullptr )
|
, m_buffer( nullptr )
|
||||||
, m_traceVersion( CurrentVersion )
|
, m_traceVersion( CurrentVersion )
|
||||||
@ -434,6 +435,15 @@ Worker::Worker( FileRead& f, EventType::Type eventMask, bool bgTasks )
|
|||||||
m_pid = 0;
|
m_pid = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( fileVer >= FileVersion( 0, 6, 5 ) )
|
||||||
|
{
|
||||||
|
f.Read( m_samplingPeriod );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_samplingPeriod = 0;
|
||||||
|
}
|
||||||
|
|
||||||
uint64_t sz;
|
uint64_t sz;
|
||||||
{
|
{
|
||||||
f.Read( sz );
|
f.Read( sz );
|
||||||
@ -5515,6 +5525,7 @@ void Worker::Write( FileWrite& f )
|
|||||||
f.Write( &m_data.lastTime, sizeof( m_data.lastTime ) );
|
f.Write( &m_data.lastTime, sizeof( m_data.lastTime ) );
|
||||||
f.Write( &m_data.frameOffset, sizeof( m_data.frameOffset ) );
|
f.Write( &m_data.frameOffset, sizeof( m_data.frameOffset ) );
|
||||||
f.Write( &m_pid, sizeof( m_pid ) );
|
f.Write( &m_pid, sizeof( m_pid ) );
|
||||||
|
f.Write( &m_samplingPeriod, sizeof( m_samplingPeriod ) );
|
||||||
|
|
||||||
uint64_t sz = m_captureName.size();
|
uint64_t sz = m_captureName.size();
|
||||||
f.Write( &sz, sizeof( sz ) );
|
f.Write( &sz, sizeof( sz ) );
|
||||||
|
Loading…
Reference in New Issue
Block a user