Save/load sampling period.

This commit is contained in:
Bartosz Taudul 2020-02-25 23:46:16 +01:00
parent af58649113
commit d6c0720f8a

View File

@ -258,6 +258,7 @@ Worker::Worker( const std::string& program, const std::vector<ImportEventTimelin
, m_captureProgram( program )
, m_captureTime( 0 )
, m_pid( 0 )
, m_samplingPeriod( 0 )
, m_stream( nullptr )
, m_buffer( nullptr )
, m_traceVersion( CurrentVersion )
@ -434,6 +435,15 @@ Worker::Worker( FileRead& f, EventType::Type eventMask, bool bgTasks )
m_pid = 0;
}
if( fileVer >= FileVersion( 0, 6, 5 ) )
{
f.Read( m_samplingPeriod );
}
else
{
m_samplingPeriod = 0;
}
uint64_t 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.frameOffset, sizeof( m_data.frameOffset ) );
f.Write( &m_pid, sizeof( m_pid ) );
f.Write( &m_samplingPeriod, sizeof( m_samplingPeriod ) );
uint64_t sz = m_captureName.size();
f.Write( &sz, sizeof( sz ) );