mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-25 23:44:35 +00:00
Ability to display inline function cost percentages relative to base symbol.
This commit is contained in:
parent
6235343286
commit
6c34e02dc2
@ -495,6 +495,7 @@ private:
|
||||
bool m_showUnknownFrames = true;
|
||||
bool m_statSeparateInlines = false;
|
||||
bool m_mergeInlines = false;
|
||||
bool m_relativeInlines = false;
|
||||
bool m_statShowAddress = false;
|
||||
bool m_statShowKernel = true;
|
||||
bool m_groupChildrenLocations = false;
|
||||
|
@ -383,6 +383,7 @@ void View::DrawSamplesStatistics( Vector<SymList>& data, int64_t timeRange, Accu
|
||||
ImGui::TableNextColumn();
|
||||
TextDisabledUnformatted( imageName );
|
||||
ImGui::TableNextColumn();
|
||||
const auto baseCnt = cnt;
|
||||
if( cnt > 0 )
|
||||
{
|
||||
char buf[64];
|
||||
@ -420,6 +421,7 @@ void View::DrawSamplesStatistics( Vector<SymList>& data, int64_t timeRange, Accu
|
||||
{
|
||||
assert( v.count > 0 );
|
||||
assert( symlen != 0 );
|
||||
const auto revBaseCnt = 100.0 / baseCnt;
|
||||
auto inSym = m_worker.GetInlineSymbolList( v.symAddr, symlen );
|
||||
assert( inSym != nullptr );
|
||||
const auto symEnd = v.symAddr + symlen;
|
||||
@ -642,13 +644,28 @@ void View::DrawSamplesStatistics( Vector<SymList>& data, int64_t timeRange, Accu
|
||||
{
|
||||
const auto t = cnt * period;
|
||||
ImGui::TextUnformatted( TimeToString( t ) );
|
||||
if( m_relativeInlines )
|
||||
{
|
||||
const auto tBase = baseCnt * period;
|
||||
PrintStringPercent( buf, 100. * t / tBase );
|
||||
}
|
||||
else
|
||||
{
|
||||
PrintStringPercent( buf, 100. * t / timeRange );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ImGui::TextUnformatted( RealToString( cnt ) );
|
||||
if( m_relativeInlines )
|
||||
{
|
||||
PrintStringPercent( buf, cnt * revBaseCnt );
|
||||
}
|
||||
else
|
||||
{
|
||||
PrintStringPercent( buf, cnt * revSampleCount100 );
|
||||
}
|
||||
}
|
||||
ImGui::SameLine();
|
||||
TextDisabledUnformatted( buf );
|
||||
}
|
||||
|
@ -304,6 +304,10 @@ void View::DrawStatistics()
|
||||
ImGui::SameLine();
|
||||
ImGui::Spacing();
|
||||
ImGui::SameLine();
|
||||
ImGui::Checkbox( "Relative", &m_relativeInlines );
|
||||
ImGui::SameLine();
|
||||
ImGui::Spacing();
|
||||
ImGui::SameLine();
|
||||
ImGui::Checkbox( ICON_FA_AT " Address", &m_statShowAddress );
|
||||
ImGui::SameLine();
|
||||
ImGui::Spacing();
|
||||
|
Loading…
Reference in New Issue
Block a user