mirror of
https://github.com/wolfpld/tracy.git
synced 2025-03-20 07:40:02 +08:00
Display package, core info on CPU data timeline.
This commit is contained in:
parent
db3e802643
commit
7ac47ab6bb
@ -4638,6 +4638,7 @@ int View::DrawCpuData( int offset, double pxns, const ImVec2& wpos, bool hover,
|
|||||||
draw->AddLine( wpos + ImVec2( 0, offset+sty ), wpos + ImVec2( w, offset+sty ), 0x22DD88DD );
|
draw->AddLine( wpos + ImVec2( 0, offset+sty ), wpos + ImVec2( w, offset+sty ), 0x22DD88DD );
|
||||||
|
|
||||||
auto& cs = cpuData[i].cs;
|
auto& cs = cpuData[i].cs;
|
||||||
|
auto tt = m_worker.GetThreadTopology( i );
|
||||||
|
|
||||||
auto it = std::lower_bound( cs.begin(), cs.end(), std::max<int64_t>( 0, m_vd.zvStart ), [] ( const auto& l, const auto& r ) { return (uint64_t)l.End() < (uint64_t)r; } );
|
auto it = std::lower_bound( cs.begin(), cs.end(), std::max<int64_t>( 0, m_vd.zvStart ), [] ( const auto& l, const auto& r ) { return (uint64_t)l.End() < (uint64_t)r; } );
|
||||||
if( it != cs.end() )
|
if( it != cs.end() )
|
||||||
@ -4675,6 +4676,12 @@ int View::DrawCpuData( int offset, double pxns, const ImVec2& wpos, bool hover,
|
|||||||
{
|
{
|
||||||
ImGui::PopFont();
|
ImGui::PopFont();
|
||||||
ImGui::BeginTooltip();
|
ImGui::BeginTooltip();
|
||||||
|
if( tt )
|
||||||
|
{
|
||||||
|
TextFocused( "Package:", RealToString( tt->package, true ) );
|
||||||
|
ImGui::SameLine();
|
||||||
|
TextFocused( "Core:", RealToString( tt->core, true ) );
|
||||||
|
}
|
||||||
TextFocused( "CPU:", RealToString( i, true ) );
|
TextFocused( "CPU:", RealToString( i, true ) );
|
||||||
TextFocused( "Context switch regions:", RealToString( num, true ) );
|
TextFocused( "Context switch regions:", RealToString( num, true ) );
|
||||||
ImGui::Separator();
|
ImGui::Separator();
|
||||||
@ -4780,6 +4787,12 @@ int View::DrawCpuData( int offset, double pxns, const ImVec2& wpos, bool hover,
|
|||||||
m_drawThreadHighlight = thread;
|
m_drawThreadHighlight = thread;
|
||||||
ImGui::PopFont();
|
ImGui::PopFont();
|
||||||
ImGui::BeginTooltip();
|
ImGui::BeginTooltip();
|
||||||
|
if( tt )
|
||||||
|
{
|
||||||
|
TextFocused( "Package:", RealToString( tt->package, true ) );
|
||||||
|
ImGui::SameLine();
|
||||||
|
TextFocused( "Core:", RealToString( tt->core, true ) );
|
||||||
|
}
|
||||||
TextFocused( "CPU:", RealToString( i, true ) );
|
TextFocused( "CPU:", RealToString( i, true ) );
|
||||||
if( local )
|
if( local )
|
||||||
{
|
{
|
||||||
@ -4834,14 +4847,27 @@ int View::DrawCpuData( int offset, double pxns, const ImVec2& wpos, bool hover,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
char buf[32];
|
char buf[64];
|
||||||
sprintf( buf, "CPU %i", i );
|
if( tt )
|
||||||
|
{
|
||||||
|
sprintf( buf, "[%i:%i] CPU %i", tt->package, tt->core, i );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
sprintf( buf, "CPU %i", i );
|
||||||
|
}
|
||||||
const auto txtx = ImGui::CalcTextSize( buf ).x;
|
const auto txtx = ImGui::CalcTextSize( buf ).x;
|
||||||
DrawTextContrast( draw, wpos + ImVec2( ty, offset-1 ), 0xFFDD88DD, buf );
|
DrawTextContrast( draw, wpos + ImVec2( ty, offset-1 ), 0xFFDD88DD, buf );
|
||||||
if( hover && ImGui::IsMouseHoveringRect( wpos + ImVec2( 0, offset-1 ), wpos + ImVec2( sty + txtx, offset + sty - 1 ) ) )
|
if( hover && ImGui::IsMouseHoveringRect( wpos + ImVec2( 0, offset-1 ), wpos + ImVec2( sty + txtx, offset + sty - 1 ) ) )
|
||||||
{
|
{
|
||||||
ImGui::PopFont();
|
ImGui::PopFont();
|
||||||
ImGui::BeginTooltip();
|
ImGui::BeginTooltip();
|
||||||
|
if( tt )
|
||||||
|
{
|
||||||
|
TextFocused( "Package:", RealToString( tt->package, true ) );
|
||||||
|
ImGui::SameLine();
|
||||||
|
TextFocused( "Core:", RealToString( tt->core, true ) );
|
||||||
|
}
|
||||||
TextFocused( "CPU:", RealToString( i, true ) );
|
TextFocused( "CPU:", RealToString( i, true ) );
|
||||||
TextFocused( "Context switch regions:", RealToString( cs.size(), true ) );
|
TextFocused( "Context switch regions:", RealToString( cs.size(), true ) );
|
||||||
ImGui::EndTooltip();
|
ImGui::EndTooltip();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user