From 8bb13ca09e9dcf12efec63e9d2d837c8177d0f13 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Tue, 27 Aug 2019 22:35:53 +0200 Subject: [PATCH] Use captured program name in CPU data. This fixes android application names, which are cut to show only last 15-or-so letters. --- server/TracyView.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index c1fdcb00..13462aa0 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -10484,14 +10484,16 @@ void View::DrawCpuDataWindow() char buf[128]; auto& pid = *pidit; const auto pidMatch = thisPid != 0 && thisPid == pid.first; + auto name = m_worker.GetExternalName( pid.second.tids[0] ).first; if( pidMatch ) { + name = m_worker.GetCaptureProgram().c_str(); ImGui::PushStyleColor( ImGuiCol_Text, ImVec4( 0.2f, 1.0f, 0.2f, 1.0f ) ); } const auto pidtxt = pid.first == 0 ? "Unknown" : RealToString( pid.first, true ); const auto expand = ImGui::TreeNode( pidtxt ); ImGui::NextColumn(); - ImGui::TextUnformatted( m_worker.GetExternalName( pid.second.tids[0] ).first ); + ImGui::TextUnformatted( name ); ImGui::NextColumn(); sprintf( buf, "%s (%.2f%%)", TimeToString( pid.second.data.runningTime ), double( pid.second.data.runningTime ) * rtimespan * 100 ); ImGui::ProgressBar( double( pid.second.data.runningTime ) * rtimespan, ImVec2( -1, ty ), buf );