mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-23 06:44:35 +00:00
Compress thread id in MessageData.
This commit is contained in:
parent
ede26b0caf
commit
a2f968d843
@ -279,7 +279,7 @@ struct MessageData
|
|||||||
{
|
{
|
||||||
int64_t time;
|
int64_t time;
|
||||||
StringRef ref;
|
StringRef ref;
|
||||||
uint64_t thread;
|
uint16_t thread;
|
||||||
uint32_t color;
|
uint32_t color;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -2100,7 +2100,7 @@ void View::DrawZones()
|
|||||||
float animOff = 0;
|
float animOff = 0;
|
||||||
if( dist > 1 )
|
if( dist > 1 )
|
||||||
{
|
{
|
||||||
if( m_msgHighlight && m_msgHighlight->thread == v->id )
|
if( m_msgHighlight && m_worker.DecompressThread( m_msgHighlight->thread ) == v->id )
|
||||||
{
|
{
|
||||||
const auto hTime = m_msgHighlight->time;
|
const auto hTime = m_msgHighlight->time;
|
||||||
if( (*msgit)->time <= hTime && ( next == v->messages.end() || (*next)->time > hTime ) )
|
if( (*msgit)->time <= hTime && ( next == v->messages.end() || (*next)->time > hTime ) )
|
||||||
@ -6826,7 +6826,8 @@ void View::DrawMessages()
|
|||||||
const auto filterActive = m_messageFilter.IsActive();
|
const auto filterActive = m_messageFilter.IsActive();
|
||||||
for( const auto& v : msgs )
|
for( const auto& v : msgs )
|
||||||
{
|
{
|
||||||
if( VisibleMsgThread( v->thread ) )
|
const auto tid = m_worker.DecompressThread( v->thread );
|
||||||
|
if( VisibleMsgThread( tid ) )
|
||||||
{
|
{
|
||||||
const auto text = m_worker.GetString( v->ref );
|
const auto text = m_worker.GetString( v->ref );
|
||||||
if( !filterActive || m_messageFilter.PassFilter( text ) )
|
if( !filterActive || m_messageFilter.PassFilter( text ) )
|
||||||
@ -6848,9 +6849,9 @@ void View::DrawMessages()
|
|||||||
}
|
}
|
||||||
ImGui::PopID();
|
ImGui::PopID();
|
||||||
ImGui::NextColumn();
|
ImGui::NextColumn();
|
||||||
ImGui::TextUnformatted( m_worker.GetThreadName( v->thread ) );
|
ImGui::TextUnformatted( m_worker.GetThreadName( tid ) );
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
ImGui::TextDisabled( "(%s)", RealToString( v->thread, true ) );
|
ImGui::TextDisabled( "(%s)", RealToString( tid, true ) );
|
||||||
ImGui::NextColumn();
|
ImGui::NextColumn();
|
||||||
ImGui::PushStyleColor( ImGuiCol_Text, v->color );
|
ImGui::PushStyleColor( ImGuiCol_Text, v->color );
|
||||||
ImGui::TextWrapped( "%s", text );
|
ImGui::TextWrapped( "%s", text );
|
||||||
|
@ -913,6 +913,7 @@ Worker::Worker( FileRead& f, EventType::Type eventMask )
|
|||||||
f.Read( msz );
|
f.Read( msz );
|
||||||
if( eventMask & EventType::Messages )
|
if( eventMask & EventType::Messages )
|
||||||
{
|
{
|
||||||
|
const auto ctid = CompressThread( tid );
|
||||||
td->messages.reserve_exact( msz, m_slab );
|
td->messages.reserve_exact( msz, m_slab );
|
||||||
for( uint64_t j=0; j<msz; j++ )
|
for( uint64_t j=0; j<msz; j++ )
|
||||||
{
|
{
|
||||||
@ -920,7 +921,7 @@ Worker::Worker( FileRead& f, EventType::Type eventMask )
|
|||||||
f.Read( ptr );
|
f.Read( ptr );
|
||||||
auto md = msgMap[ptr];
|
auto md = msgMap[ptr];
|
||||||
td->messages[j] = md;
|
td->messages[j] = md;
|
||||||
md->thread = tid;
|
md->thread = ctid;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -3648,7 +3649,7 @@ void Worker::ProcessMessage( const QueueMessage& ev )
|
|||||||
auto msg = m_slab.Alloc<MessageData>();
|
auto msg = m_slab.Alloc<MessageData>();
|
||||||
msg->time = TscTime( ev.time - m_data.baseTime );
|
msg->time = TscTime( ev.time - m_data.baseTime );
|
||||||
msg->ref = StringRef( StringRef::Type::Idx, it->second.idx );
|
msg->ref = StringRef( StringRef::Type::Idx, it->second.idx );
|
||||||
msg->thread = m_threadCtx;
|
msg->thread = CompressThread( m_threadCtx );
|
||||||
msg->color = 0xFFFFFFFF;
|
msg->color = 0xFFFFFFFF;
|
||||||
m_data.lastTime = std::max( m_data.lastTime, msg->time );
|
m_data.lastTime = std::max( m_data.lastTime, msg->time );
|
||||||
InsertMessageData( msg, m_threadCtx );
|
InsertMessageData( msg, m_threadCtx );
|
||||||
@ -3661,7 +3662,7 @@ void Worker::ProcessMessageLiteral( const QueueMessage& ev )
|
|||||||
auto msg = m_slab.Alloc<MessageData>();
|
auto msg = m_slab.Alloc<MessageData>();
|
||||||
msg->time = TscTime( ev.time - m_data.baseTime );
|
msg->time = TscTime( ev.time - m_data.baseTime );
|
||||||
msg->ref = StringRef( StringRef::Type::Ptr, ev.text );
|
msg->ref = StringRef( StringRef::Type::Ptr, ev.text );
|
||||||
msg->thread = m_threadCtx;
|
msg->thread = CompressThread( m_threadCtx );
|
||||||
msg->color = 0xFFFFFFFF;
|
msg->color = 0xFFFFFFFF;
|
||||||
m_data.lastTime = std::max( m_data.lastTime, msg->time );
|
m_data.lastTime = std::max( m_data.lastTime, msg->time );
|
||||||
InsertMessageData( msg, m_threadCtx );
|
InsertMessageData( msg, m_threadCtx );
|
||||||
@ -3674,7 +3675,7 @@ void Worker::ProcessMessageColor( const QueueMessageColor& ev )
|
|||||||
auto msg = m_slab.Alloc<MessageData>();
|
auto msg = m_slab.Alloc<MessageData>();
|
||||||
msg->time = TscTime( ev.time - m_data.baseTime );
|
msg->time = TscTime( ev.time - m_data.baseTime );
|
||||||
msg->ref = StringRef( StringRef::Type::Idx, it->second.idx );
|
msg->ref = StringRef( StringRef::Type::Idx, it->second.idx );
|
||||||
msg->thread = m_threadCtx;
|
msg->thread = CompressThread( m_threadCtx );
|
||||||
msg->color = 0xFF000000 | ( ev.r << 16 ) | ( ev.g << 8 ) | ev.b;
|
msg->color = 0xFF000000 | ( ev.r << 16 ) | ( ev.g << 8 ) | ev.b;
|
||||||
m_data.lastTime = std::max( m_data.lastTime, msg->time );
|
m_data.lastTime = std::max( m_data.lastTime, msg->time );
|
||||||
InsertMessageData( msg, m_threadCtx );
|
InsertMessageData( msg, m_threadCtx );
|
||||||
@ -3687,7 +3688,7 @@ void Worker::ProcessMessageLiteralColor( const QueueMessageColor& ev )
|
|||||||
auto msg = m_slab.Alloc<MessageData>();
|
auto msg = m_slab.Alloc<MessageData>();
|
||||||
msg->time = TscTime( ev.time - m_data.baseTime );
|
msg->time = TscTime( ev.time - m_data.baseTime );
|
||||||
msg->ref = StringRef( StringRef::Type::Ptr, ev.text );
|
msg->ref = StringRef( StringRef::Type::Ptr, ev.text );
|
||||||
msg->thread = m_threadCtx;
|
msg->thread = CompressThread( m_threadCtx );
|
||||||
msg->color = 0xFF000000 | ( ev.r << 16 ) | ( ev.g << 8 ) | ev.b;
|
msg->color = 0xFF000000 | ( ev.r << 16 ) | ( ev.g << 8 ) | ev.b;
|
||||||
m_data.lastTime = std::max( m_data.lastTime, msg->time );
|
m_data.lastTime = std::max( m_data.lastTime, msg->time );
|
||||||
InsertMessageData( msg, m_threadCtx );
|
InsertMessageData( msg, m_threadCtx );
|
||||||
|
Loading…
Reference in New Issue
Block a user