mirror of
https://github.com/wolfpld/tracy
synced 2025-04-29 04:23:51 +00:00
Add option to display top cost inlines in symbol statistics list.
This commit is contained in:
parent
ae2a7c60b8
commit
2d6bcff3a6
@ -521,6 +521,7 @@ private:
|
||||
bool m_statSeparateInlines = false;
|
||||
bool m_mergeInlines = false;
|
||||
bool m_relativeInlines = false;
|
||||
bool m_topInline = false;
|
||||
bool m_statShowAddress = false;
|
||||
bool m_statShowKernel = true;
|
||||
bool m_groupChildrenLocations = false;
|
||||
|
@ -272,7 +272,7 @@ void View::DrawSamplesStatistics( Vector<SymList>& data, int64_t timeRange, Accu
|
||||
}
|
||||
|
||||
Vector<SymList> inSymList;
|
||||
if( !m_statSeparateInlines && !hasNoSamples && v.count > 0 && v.symAddr != 0 && expand )
|
||||
if( !m_statSeparateInlines && !hasNoSamples && v.count > 0 && v.symAddr != 0 && ( expand || m_topInline ) )
|
||||
{
|
||||
assert( v.count > 0 );
|
||||
assert( symlen != 0 );
|
||||
@ -364,6 +364,7 @@ void View::DrawSamplesStatistics( Vector<SymList>& data, int64_t timeRange, Accu
|
||||
}
|
||||
}
|
||||
|
||||
const auto origName = name;
|
||||
if( hasNoSamples )
|
||||
{
|
||||
if( isKernel )
|
||||
@ -383,6 +384,15 @@ void View::DrawSamplesStatistics( Vector<SymList>& data, int64_t timeRange, Accu
|
||||
}
|
||||
else
|
||||
{
|
||||
if( !inSymList.empty() && m_topInline )
|
||||
{
|
||||
const auto topName = m_worker.GetString( symMap.find( inSymList[0].symAddr )->second.name );
|
||||
if( topName != name )
|
||||
{
|
||||
parentName = name;
|
||||
name = topName;
|
||||
}
|
||||
}
|
||||
ImGui::PushID( idx++ );
|
||||
bool clicked;
|
||||
if( isKernel )
|
||||
@ -552,7 +562,22 @@ void View::DrawSamplesStatistics( Vector<SymList>& data, int64_t timeRange, Accu
|
||||
break;
|
||||
}
|
||||
|
||||
const auto sn = iv.symAddr == v.symAddr ? "[ - self - ]" : name;
|
||||
const char* sn;
|
||||
if( iv.symAddr == v.symAddr )
|
||||
{
|
||||
if( parentName )
|
||||
{
|
||||
sn = parentName;
|
||||
}
|
||||
else
|
||||
{
|
||||
sn = "[ - self - ]";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
sn = name;
|
||||
}
|
||||
if( m_mergeInlines || iv.excl == 0 )
|
||||
{
|
||||
if( m_vd.shortenName == ShortenName::Never )
|
||||
|
@ -563,6 +563,10 @@ void View::DrawStatistics()
|
||||
ImGui::Spacing();
|
||||
ImGui::SameLine();
|
||||
ImGui::Checkbox( ICON_FA_LINK " Base relative", &m_relativeInlines );
|
||||
ImGui::SameLine();
|
||||
ImGui::Spacing();
|
||||
ImGui::SameLine();
|
||||
ImGui::Checkbox( ICON_FA_FIRE " Top inline", &m_topInline );
|
||||
if( m_statSeparateInlines ) ImGui::EndDisabled();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user