mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-10 10:41:50 +00:00
Add cost criteria selection UI.
This commit is contained in:
parent
7ad9cafefb
commit
cc0ca341bb
@ -165,6 +165,7 @@ SourceView::SourceView( ImFont* font, GetWindowCallback gwcb )
|
|||||||
, m_atnt( false )
|
, m_atnt( false )
|
||||||
, m_childCalls( false )
|
, m_childCalls( false )
|
||||||
, m_hwSamples( true )
|
, m_hwSamples( true )
|
||||||
|
, m_cost( 0 )
|
||||||
, m_showJumps( true )
|
, m_showJumps( true )
|
||||||
, m_cpuArch( CpuArchUnknown )
|
, m_cpuArch( CpuArchUnknown )
|
||||||
, m_showLatency( false )
|
, m_showLatency( false )
|
||||||
@ -1179,7 +1180,7 @@ void SourceView::RenderSymbolView( Worker& worker, View& view )
|
|||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
ImGui::Spacing();
|
ImGui::Spacing();
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
TextFocused( ICON_FA_WEIGHT_HANGING " Code size:", MemSizeToString( m_codeLen ) );
|
TextFocused( ICON_FA_WEIGHT_HANGING " Code:", MemSizeToString( m_codeLen ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
AddrStat iptotalSrc = {}, iptotalAsm = {};
|
AddrStat iptotalSrc = {}, iptotalAsm = {};
|
||||||
@ -1212,6 +1213,29 @@ void SourceView::RenderSymbolView( Worker& worker, View& view )
|
|||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
ImGui::Spacing();
|
ImGui::Spacing();
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
|
if( worker.GetHwSampleCountAddress() != 0 )
|
||||||
|
{
|
||||||
|
SmallCheckbox( ICON_FA_HAMMER " Hw samples", &m_hwSamples );
|
||||||
|
ImGui::SameLine();
|
||||||
|
ImGui::Spacing();
|
||||||
|
ImGui::SameLine();
|
||||||
|
ImGui::TextUnformatted( ICON_FA_HIGHLIGHTER " Cost" );
|
||||||
|
ImGui::SameLine();
|
||||||
|
const char* items[] = { "Sample count", "Cycles", "Retirements" };
|
||||||
|
float mw = 0;
|
||||||
|
for( auto& v : items )
|
||||||
|
{
|
||||||
|
const auto w = ImGui::CalcTextSize( v ).x;
|
||||||
|
if( w > mw ) mw = w;
|
||||||
|
}
|
||||||
|
ImGui::SetNextItemWidth( mw + ImGui::GetFontSize() );
|
||||||
|
ImGui::PushStyleVar( ImGuiStyleVar_FramePadding, ImVec2( 0, 0 ) );
|
||||||
|
ImGui::Combo( "##cost", &m_cost, items, sizeof( items ) / sizeof( *items ) );
|
||||||
|
ImGui::PopStyleVar();
|
||||||
|
ImGui::SameLine();
|
||||||
|
ImGui::Spacing();
|
||||||
|
ImGui::SameLine();
|
||||||
|
}
|
||||||
if( !slzReady )
|
if( !slzReady )
|
||||||
{
|
{
|
||||||
ImGui::PushItemFlag( ImGuiItemFlags_Disabled, true );
|
ImGui::PushItemFlag( ImGuiItemFlags_Disabled, true );
|
||||||
@ -1222,13 +1246,6 @@ void SourceView::RenderSymbolView( Worker& worker, View& view )
|
|||||||
{
|
{
|
||||||
m_childCalls = !m_childCalls;
|
m_childCalls = !m_childCalls;
|
||||||
}
|
}
|
||||||
if( worker.GetHwSampleCountAddress() != 0 )
|
|
||||||
{
|
|
||||||
SmallCheckbox( ICON_FA_HAND_POINT_DOWN " Hardware samples", &m_hwSamples );
|
|
||||||
ImGui::SameLine();
|
|
||||||
ImGui::Spacing();
|
|
||||||
ImGui::SameLine();
|
|
||||||
}
|
|
||||||
SmallCheckbox( ICON_FA_SIGN_OUT_ALT " Child calls", &m_childCalls );
|
SmallCheckbox( ICON_FA_SIGN_OUT_ALT " Child calls", &m_childCalls );
|
||||||
if( !slzReady )
|
if( !slzReady )
|
||||||
{
|
{
|
||||||
|
@ -186,6 +186,7 @@ private:
|
|||||||
uint64_t m_jumpPopupAddr;
|
uint64_t m_jumpPopupAddr;
|
||||||
bool m_hwSamples;
|
bool m_hwSamples;
|
||||||
bool m_childCalls;
|
bool m_childCalls;
|
||||||
|
int m_cost;
|
||||||
|
|
||||||
SourceContents m_source;
|
SourceContents m_source;
|
||||||
SourceContents m_sourceTooltip;
|
SourceContents m_sourceTooltip;
|
||||||
|
Loading…
Reference in New Issue
Block a user