Display raw callstack payload.

This commit is contained in:
Bartosz Taudul 2018-06-19 22:19:33 +02:00
parent 4eea85fdad
commit 4ba95145da
2 changed files with 45 additions and 1 deletions

View File

@ -4774,7 +4774,7 @@ void View::ListMemData( T ptr, T end, std::function<const MemEvent*(T&)> DrawAdd
const auto ty = ImGui::GetTextLineHeight() + style.ItemSpacing.y;
ImGui::BeginChild( "##memScroll", ImVec2( 0, std::max( ty * std::min<int64_t>( dist, 5 ), std::min( ty * dist, ImGui::GetContentRegionAvail().y ) ) ) );
ImGui::Columns( 7 );
ImGui::Columns( 8 );
ImGui::Text( "Address" );
ImGui::NextColumn();
ImGui::Text( "Size" );
@ -4815,6 +4815,8 @@ void View::ListMemData( T ptr, T end, std::function<const MemEvent*(T&)> DrawAdd
ImGui::EndTooltip();
}
ImGui::NextColumn();
ImGui::Text( "Callstack" );
ImGui::NextColumn();
ImGui::Separator();
int idx = 0;
while( ptr != end )
@ -4918,6 +4920,34 @@ void View::ListMemData( T ptr, T end, std::function<const MemEvent*(T&)> DrawAdd
}
}
ImGui::NextColumn();
if( v->csAlloc == 0 )
{
ImGui::TextDisabled( "[alloc]" );
}
else
{
ImGui::Text( "[alloc]" );
if( ImGui::IsItemHovered() )
{
CallstackTooltip( v->csAlloc );
}
}
ImGui::SameLine();
ImGui::Spacing();
ImGui::SameLine();
if( v->csFree == 0 )
{
ImGui::TextDisabled( "[free]" );
}
else
{
ImGui::Text( "[free]" );
if( ImGui::IsItemHovered() )
{
CallstackTooltip( v->csFree );
}
}
ImGui::NextColumn();
ptr++;
}
ImGui::EndColumns();
@ -5537,6 +5567,18 @@ void View::ZoneTooltip( const GpuEvent& ev )
ImGui::EndTooltip();
}
void View::CallstackTooltip( uint32_t idx )
{
auto& cs = m_worker.GetCallstack( idx );
ImGui::BeginTooltip();
for( auto& entry : cs )
{
ImGui::Text( "0x%" PRIX64, entry );
}
ImGui::EndTooltip();
}
const ZoneEvent* View::GetZoneParent( const ZoneEvent& zone ) const
{
for( const auto& thread : m_worker.GetThreadData() )

View File

@ -110,6 +110,8 @@ private:
void ZoneTooltip( const ZoneEvent& ev );
void ZoneTooltip( const GpuEvent& ev );
void CallstackTooltip( uint32_t idx );
const ZoneEvent* GetZoneParent( const ZoneEvent& zone ) const;
const GpuEvent* GetZoneParent( const GpuEvent& zone ) const;
uint64_t GetZoneThread( const ZoneEvent& zone ) const;