mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-22 14:44:34 +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_showUnknownFrames = true;
|
||||||
bool m_statSeparateInlines = false;
|
bool m_statSeparateInlines = false;
|
||||||
bool m_mergeInlines = false;
|
bool m_mergeInlines = false;
|
||||||
|
bool m_relativeInlines = false;
|
||||||
bool m_statShowAddress = false;
|
bool m_statShowAddress = false;
|
||||||
bool m_statShowKernel = true;
|
bool m_statShowKernel = true;
|
||||||
bool m_groupChildrenLocations = false;
|
bool m_groupChildrenLocations = false;
|
||||||
|
@ -383,6 +383,7 @@ void View::DrawSamplesStatistics( Vector<SymList>& data, int64_t timeRange, Accu
|
|||||||
ImGui::TableNextColumn();
|
ImGui::TableNextColumn();
|
||||||
TextDisabledUnformatted( imageName );
|
TextDisabledUnformatted( imageName );
|
||||||
ImGui::TableNextColumn();
|
ImGui::TableNextColumn();
|
||||||
|
const auto baseCnt = cnt;
|
||||||
if( cnt > 0 )
|
if( cnt > 0 )
|
||||||
{
|
{
|
||||||
char buf[64];
|
char buf[64];
|
||||||
@ -420,6 +421,7 @@ void View::DrawSamplesStatistics( Vector<SymList>& data, int64_t timeRange, Accu
|
|||||||
{
|
{
|
||||||
assert( v.count > 0 );
|
assert( v.count > 0 );
|
||||||
assert( symlen != 0 );
|
assert( symlen != 0 );
|
||||||
|
const auto revBaseCnt = 100.0 / baseCnt;
|
||||||
auto inSym = m_worker.GetInlineSymbolList( v.symAddr, symlen );
|
auto inSym = m_worker.GetInlineSymbolList( v.symAddr, symlen );
|
||||||
assert( inSym != nullptr );
|
assert( inSym != nullptr );
|
||||||
const auto symEnd = v.symAddr + symlen;
|
const auto symEnd = v.symAddr + symlen;
|
||||||
@ -642,12 +644,27 @@ void View::DrawSamplesStatistics( Vector<SymList>& data, int64_t timeRange, Accu
|
|||||||
{
|
{
|
||||||
const auto t = cnt * period;
|
const auto t = cnt * period;
|
||||||
ImGui::TextUnformatted( TimeToString( t ) );
|
ImGui::TextUnformatted( TimeToString( t ) );
|
||||||
PrintStringPercent( buf, 100. * t / timeRange );
|
if( m_relativeInlines )
|
||||||
|
{
|
||||||
|
const auto tBase = baseCnt * period;
|
||||||
|
PrintStringPercent( buf, 100. * t / tBase );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
PrintStringPercent( buf, 100. * t / timeRange );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ImGui::TextUnformatted( RealToString( cnt ) );
|
ImGui::TextUnformatted( RealToString( cnt ) );
|
||||||
PrintStringPercent( buf, cnt * revSampleCount100 );
|
if( m_relativeInlines )
|
||||||
|
{
|
||||||
|
PrintStringPercent( buf, cnt * revBaseCnt );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
PrintStringPercent( buf, cnt * revSampleCount100 );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
TextDisabledUnformatted( buf );
|
TextDisabledUnformatted( buf );
|
||||||
|
@ -304,6 +304,10 @@ void View::DrawStatistics()
|
|||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
ImGui::Spacing();
|
ImGui::Spacing();
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
|
ImGui::Checkbox( "Relative", &m_relativeInlines );
|
||||||
|
ImGui::SameLine();
|
||||||
|
ImGui::Spacing();
|
||||||
|
ImGui::SameLine();
|
||||||
ImGui::Checkbox( ICON_FA_AT " Address", &m_statShowAddress );
|
ImGui::Checkbox( ICON_FA_AT " Address", &m_statShowAddress );
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
ImGui::Spacing();
|
ImGui::Spacing();
|
||||||
|
Loading…
Reference in New Issue
Block a user