mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-26 16:04:34 +00:00
Save and load callstack frames.
This commit is contained in:
parent
e56ee377f4
commit
9a5329b97d
@ -640,6 +640,19 @@ Worker::Worker( FileRead& f, EventType::Type eventMask )
|
||||
|
||||
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>
|
||||
@ -2534,6 +2547,14 @@ void Worker::Write( FileWrite& f )
|
||||
f.Write( &csz, sizeof( 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 )
|
||||
|
Loading…
Reference in New Issue
Block a user