Save/load tid to pid mapping.

This commit is contained in:
Bartosz Taudul 2019-08-17 22:36:21 +02:00
parent 20e8a5ecc8
commit 1498417a8d

View File

@ -1508,6 +1508,17 @@ Worker::Worker( FileRead& f, EventType::Type eventMask )
} }
} }
if( fileVer >= FileVersion( 0, 5, 5 ) )
{
f.Read( sz );
for( uint64_t i=0; i<sz; i++ )
{
uint64_t tid, pid;
f.Read2( tid, pid );
m_data.tidToPid.emplace( tid, pid );
}
}
s_loadProgress.total.store( 0, std::memory_order_relaxed ); s_loadProgress.total.store( 0, std::memory_order_relaxed );
m_loadTime = std::chrono::duration_cast<std::chrono::nanoseconds>( std::chrono::high_resolution_clock::now() - loadStart ).count(); m_loadTime = std::chrono::duration_cast<std::chrono::nanoseconds>( std::chrono::high_resolution_clock::now() - loadStart ).count();
@ -5039,6 +5050,14 @@ void Worker::Write( FileWrite& f )
f.Write( &thread, sizeof( thread ) ); f.Write( &thread, sizeof( thread ) );
} }
} }
sz = m_data.tidToPid.size();
f.Write( &sz, sizeof( sz ) );
for( auto& v : m_data.tidToPid )
{
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 ) void Worker::WriteTimeline( FileWrite& f, const Vector<ZoneEvent*>& vec, int64_t& refTime )