Save and load callstack frames.

This commit is contained in:
Bartosz Taudul 2018-06-20 01:59:25 +02:00
parent e56ee377f4
commit 9a5329b97d

View File

@ -640,6 +640,19 @@ Worker::Worker( FileRead& f, EventType::Type eventMask )
m_data.callstackPayload.push_back_no_space_check( arr ); m_data.callstackPayload.push_back_no_space_check( arr );
} }
f.Read( sz );
m_data.callstackFrameMap.reserve( sz );
for( uint64_t i=0; i<sz; i++ )
{
uint64_t ptr;
f.Read( ptr );
auto frame = m_slab.Alloc<CallstackFrame>();
f.Read( frame, sizeof( CallstackFrame ) );
m_data.callstackFrameMap.emplace( ptr, frame );
}
} }
template<class T> template<class T>
@ -2534,6 +2547,14 @@ void Worker::Write( FileWrite& f )
f.Write( &csz, sizeof( csz ) ); f.Write( &csz, sizeof( csz ) );
f.Write( cs->data(), sizeof( uint64_t ) * csz ); f.Write( cs->data(), sizeof( uint64_t ) * csz );
} }
sz = m_data.callstackFrameMap.size();
f.Write( &sz, sizeof( sz ) );
for( auto& frame : m_data.callstackFrameMap )
{
f.Write( &frame.first, sizeof( uint64_t ) );
f.Write( frame.second, sizeof( CallstackFrame ) );
}
} }
void Worker::WriteTimeline( FileWrite& f, const Vector<ZoneEvent*>& vec ) void Worker::WriteTimeline( FileWrite& f, const Vector<ZoneEvent*>& vec )