mirror of
https://github.com/wolfpld/tracy
synced 2025-04-29 04:23:51 +00:00
Save/load callstack samples.
This commit is contained in:
parent
e270603117
commit
597911e5a8
@ -7,7 +7,7 @@ namespace Version
|
||||
{
|
||||
enum { Major = 0 };
|
||||
enum { Minor = 6 };
|
||||
enum { Patch = 3 };
|
||||
enum { Patch = 4 };
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -984,6 +984,31 @@ Worker::Worker( FileRead& f, EventType::Type eventMask, bool bgTasks )
|
||||
{
|
||||
f.Skip( msz * sizeof( uint64_t ) );
|
||||
}
|
||||
if( fileVer >= FileVersion( 0, 6, 4 ) )
|
||||
{
|
||||
uint64_t ssz;
|
||||
f.Read( ssz );
|
||||
if( ssz != 0 )
|
||||
{
|
||||
if( eventMask & EventType::Samples )
|
||||
{
|
||||
m_data.samplesCnt += ssz;
|
||||
int64_t refTime = 0;
|
||||
td->samples.reserve_exact( ssz, m_slab );
|
||||
auto ptr = td->samples.data();
|
||||
for( uint64_t j=0; j<ssz; j++ )
|
||||
{
|
||||
ptr->time.SetVal( ReadTimeOffset( f, refTime ) );
|
||||
f.Read( &ptr->callstack, sizeof( ptr->callstack ) );
|
||||
ptr++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
f.Skip( ssz * ( 8 + 3 ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
m_data.threads[i] = td;
|
||||
m_threadMap.emplace( tid, td );
|
||||
}
|
||||
@ -5672,6 +5697,14 @@ void Worker::Write( FileWrite& f )
|
||||
auto ptr = uint64_t( (MessageData*)v );
|
||||
f.Write( &ptr, sizeof( ptr ) );
|
||||
}
|
||||
sz = thread->samples.size();
|
||||
f.Write( &sz, sizeof( sz ) );
|
||||
refTime = 0;
|
||||
for( auto& v : thread->samples )
|
||||
{
|
||||
WriteTimeOffset( f, refTime, v.time.Val() );
|
||||
f.Write( &v.callstack, sizeof( v.callstack ) );
|
||||
}
|
||||
}
|
||||
|
||||
sz = 0;
|
||||
|
@ -44,6 +44,7 @@ namespace EventType
|
||||
Memory = 1 << 3,
|
||||
FrameImages = 1 << 4,
|
||||
ContextSwitches = 1 << 5,
|
||||
Samples = 1 << 6,
|
||||
|
||||
None = 0,
|
||||
All = std::numeric_limits<uint32_t>::max()
|
||||
|
Loading…
x
Reference in New Issue
Block a user