mirror of
https://github.com/wolfpld/tracy
synced 2025-05-01 13:13:53 +00:00
Save message color data in trace dumps.
This commit is contained in:
parent
8cbd83c752
commit
74575250a5
@ -7,7 +7,7 @@ namespace Version
|
|||||||
{
|
{
|
||||||
enum { Major = 0 };
|
enum { Major = 0 };
|
||||||
enum { Minor = 4 };
|
enum { Minor = 4 };
|
||||||
enum { Patch = 7 };
|
enum { Patch = 8 };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -719,7 +719,7 @@ Worker::Worker( FileRead& f, EventType::Type eventMask )
|
|||||||
if( eventMask & EventType::Messages )
|
if( eventMask & EventType::Messages )
|
||||||
{
|
{
|
||||||
m_data.messages.reserve_exact( sz, m_slab );
|
m_data.messages.reserve_exact( sz, m_slab );
|
||||||
if( fileVer >= FileVersion( 0, 4, 2 ) )
|
if( fileVer >= FileVersion( 0, 4, 8 ) )
|
||||||
{
|
{
|
||||||
int64_t refTime = 0;
|
int64_t refTime = 0;
|
||||||
for( uint64_t i=0; i<sz; i++ )
|
for( uint64_t i=0; i<sz; i++ )
|
||||||
@ -729,6 +729,22 @@ Worker::Worker( FileRead& f, EventType::Type eventMask )
|
|||||||
auto msgdata = m_slab.Alloc<MessageData>();
|
auto msgdata = m_slab.Alloc<MessageData>();
|
||||||
msgdata->time = ReadTimeOffset( f, refTime );
|
msgdata->time = ReadTimeOffset( f, refTime );
|
||||||
f.Read( msgdata->ref );
|
f.Read( msgdata->ref );
|
||||||
|
f.Read( msgdata->color );
|
||||||
|
m_data.messages[i] = msgdata;
|
||||||
|
msgMap.emplace( ptr, msgdata );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if( fileVer >= FileVersion( 0, 4, 2 ) )
|
||||||
|
{
|
||||||
|
int64_t refTime = 0;
|
||||||
|
for( uint64_t i=0; i<sz; i++ )
|
||||||
|
{
|
||||||
|
uint64_t ptr;
|
||||||
|
f.Read( ptr );
|
||||||
|
auto msgdata = m_slab.Alloc<MessageData>();
|
||||||
|
msgdata->time = ReadTimeOffset( f, refTime );
|
||||||
|
f.Read( msgdata->ref );
|
||||||
|
msgdata->color = 0xFFFFFFFF;
|
||||||
m_data.messages[i] = msgdata;
|
m_data.messages[i] = msgdata;
|
||||||
msgMap.emplace( ptr, msgdata );
|
msgMap.emplace( ptr, msgdata );
|
||||||
}
|
}
|
||||||
@ -742,6 +758,7 @@ Worker::Worker( FileRead& f, EventType::Type eventMask )
|
|||||||
auto msgdata = m_slab.Alloc<MessageData>();
|
auto msgdata = m_slab.Alloc<MessageData>();
|
||||||
f.Read( msgdata, sizeof( MessageData::time ) + sizeof( MessageData::ref ) );
|
f.Read( msgdata, sizeof( MessageData::time ) + sizeof( MessageData::ref ) );
|
||||||
if( fileVer <= FileVersion( 0, 3, 0 ) ) f.Skip( 7 );
|
if( fileVer <= FileVersion( 0, 3, 0 ) ) f.Skip( 7 );
|
||||||
|
msgdata->color = 0xFFFFFFFF;
|
||||||
m_data.messages[i] = msgdata;
|
m_data.messages[i] = msgdata;
|
||||||
msgMap.emplace( ptr, msgdata );
|
msgMap.emplace( ptr, msgdata );
|
||||||
}
|
}
|
||||||
@ -754,10 +771,14 @@ Worker::Worker( FileRead& f, EventType::Type eventMask )
|
|||||||
{
|
{
|
||||||
f.Skip( sz * ( sizeof( uint64_t ) + 24 ) );
|
f.Skip( sz * ( sizeof( uint64_t ) + 24 ) );
|
||||||
}
|
}
|
||||||
else
|
else if( fileVer <= FileVersion( 0, 4, 7 ) )
|
||||||
{
|
{
|
||||||
f.Skip( sz * ( sizeof( uint64_t ) + sizeof( MessageData::time ) + sizeof( MessageData::ref ) ) );
|
f.Skip( sz * ( sizeof( uint64_t ) + sizeof( MessageData::time ) + sizeof( MessageData::ref ) ) );
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
f.Skip( sz * ( sizeof( uint64_t ) + sizeof( MessageData::time ) + sizeof( MessageData::ref ) + sizeof( MessageData::color ) ) );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
s_loadProgress.progress.store( LoadProgress::Zones, std::memory_order_relaxed );
|
s_loadProgress.progress.store( LoadProgress::Zones, std::memory_order_relaxed );
|
||||||
@ -4067,6 +4088,7 @@ void Worker::Write( FileWrite& f )
|
|||||||
f.Write( &ptr, sizeof( ptr ) );
|
f.Write( &ptr, sizeof( ptr ) );
|
||||||
WriteTimeOffset( f, refTime, v->time );
|
WriteTimeOffset( f, refTime, v->time );
|
||||||
f.Write( &v->ref, sizeof( v->ref ) );
|
f.Write( &v->ref, sizeof( v->ref ) );
|
||||||
|
f.Write( &v->color, sizeof( v->color ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user