1
0
mirror of https://github.com/wolfpld/tracy.git synced 2025-03-20 07:40:02 +08:00

Keep things simple.

This commit is contained in:
Bartosz Taudul 2019-08-28 01:29:58 +02:00
parent d95e24f66b
commit ed83762a1a

View File

@ -10530,15 +10530,16 @@ void View::DrawCpuDataWindow()
for( auto& tid : pid.second.tids ) for( auto& tid : pid.second.tids )
{ {
const auto tidMatch = pidMatch && m_worker.IsThreadLocal( tid ); const auto tidMatch = pidMatch && m_worker.IsThreadLocal( tid );
auto tname = m_worker.GetExternalName( tid ).second; const char* tname;
if( tidMatch ) if( tidMatch )
{ {
auto lname = m_worker.GetThreadString( tid ); tname = m_worker.GetThreadName( tid );
const auto tsz = strlen( tname );
const auto lsz = strlen( lname );
if( lsz > tsz && strncmp( tname, lname, tsz ) == 0 ) tname = lname;
ImGui::PushStyleColor( ImGuiCol_Text, ImVec4( 1.0f, 1.0f, 0.2f, 1.0f ) ); ImGui::PushStyleColor( ImGuiCol_Text, ImVec4( 1.0f, 1.0f, 0.2f, 1.0f ) );
} }
else
{
tname = m_worker.GetExternalName( tid ).second;
}
const auto& tit = ctd.find( tid ); const auto& tit = ctd.find( tid );
assert( tit != ctd.end() ); assert( tit != ctd.end() );
ImGui::TextUnformatted( RealToString( tid, true ) ); ImGui::TextUnformatted( RealToString( tid, true ) );