mirror of
https://github.com/wolfpld/tracy
synced 2025-04-29 04:23:51 +00:00
Optional visualization of uarch latency.
This commit is contained in:
parent
d6e633edd0
commit
83d6566020
@ -71,6 +71,7 @@ SourceView::SourceView( ImFont* font )
|
|||||||
, m_calcInlineStats( true )
|
, m_calcInlineStats( true )
|
||||||
, m_showJumps( true )
|
, m_showJumps( true )
|
||||||
, m_cpuArch( CpuArchUnknown )
|
, m_cpuArch( CpuArchUnknown )
|
||||||
|
, m_showLatency( false )
|
||||||
{
|
{
|
||||||
SelectMicroArchitecture( "ZEN2" );
|
SelectMicroArchitecture( "ZEN2" );
|
||||||
|
|
||||||
@ -1183,6 +1184,11 @@ uint64_t SourceView::RenderSymbolAsmView( uint32_t iptotal, unordered_flat_map<u
|
|||||||
ImGui::EndCombo();
|
ImGui::EndCombo();
|
||||||
}
|
}
|
||||||
ImGui::PopStyleVar();
|
ImGui::PopStyleVar();
|
||||||
|
|
||||||
|
ImGui::SameLine();
|
||||||
|
ImGui::Spacing();
|
||||||
|
ImGui::SameLine();
|
||||||
|
SmallCheckbox( "Show latency", &m_showLatency );
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui::BeginChild( "##asmView", ImVec2( 0, 0 ), true, ImGuiWindowFlags_NoMove );
|
ImGui::BeginChild( "##asmView", ImVec2( 0, 0 ), true, ImGuiWindowFlags_NoMove );
|
||||||
@ -1824,6 +1830,25 @@ void SourceView::RenderAsmLine( const AsmLine& line, uint32_t ipcnt, uint32_t ip
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( m_showLatency && asmVar && asmVar->minlat >= 0 )
|
||||||
|
{
|
||||||
|
const auto pos = ImVec2( (int)ImGui::GetCursorScreenPos().x, (int)ImGui::GetCursorScreenPos().y );
|
||||||
|
const auto ty = ImGui::GetFontSize();
|
||||||
|
|
||||||
|
if( asmVar->minlat == 0 )
|
||||||
|
{
|
||||||
|
draw->AddLine( pos + ImVec2( 0, -1 ), pos + ImVec2( 0, ty ), 0x660000FF );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
draw->AddRectFilled( pos, pos + ImVec2( ty * asmVar->minlat + 1, ty + 1 ), 0x660000FF );
|
||||||
|
}
|
||||||
|
if( asmVar->minlat != asmVar->maxlat )
|
||||||
|
{
|
||||||
|
draw->AddRectFilled( pos + ImVec2( ty * asmVar->minlat + 1, 0 ), pos + ImVec2( ty * asmVar->maxlat + 1, ty + 1 ), 0x5500FFFF );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const auto msz = line.mnemonic.size();
|
const auto msz = line.mnemonic.size();
|
||||||
memcpy( buf, line.mnemonic.c_str(), msz );
|
memcpy( buf, line.mnemonic.c_str(), msz );
|
||||||
memset( buf+msz, ' ', m_maxMnemonicLen-msz );
|
memset( buf+msz, ' ', m_maxMnemonicLen-msz );
|
||||||
|
@ -182,6 +182,7 @@ private:
|
|||||||
CpuArchitecture m_cpuArch;
|
CpuArchitecture m_cpuArch;
|
||||||
int m_selMicroArch;
|
int m_selMicroArch;
|
||||||
int m_idxMicroArch;
|
int m_idxMicroArch;
|
||||||
|
bool m_showLatency;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user