mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-23 06:44:35 +00:00
Add zone trace.
This commit is contained in:
parent
4d0396fa06
commit
bf52b3bc98
@ -2450,6 +2450,34 @@ void View::DrawZoneInfoWindow()
|
||||
ImGui::Text( "Execution time: %s", TimeToString( ztime ) );
|
||||
ImGui::Text( "Without profiling: %s", TimeToString( ztime - m_worker.GetDelay() * dmul ) );
|
||||
|
||||
ImGui::Separator();
|
||||
|
||||
std::vector<const ZoneEvent*> zoneTrace;
|
||||
auto parent = GetZoneParent( ev );
|
||||
while( parent )
|
||||
{
|
||||
zoneTrace.emplace_back( parent );
|
||||
parent = GetZoneParent( *parent );
|
||||
}
|
||||
if( !zoneTrace.empty() )
|
||||
{
|
||||
bool expand = ImGui::TreeNode( "Zone trace" );
|
||||
ImGui::SameLine();
|
||||
ImGui::TextDisabled( "(%s)", RealToString( zoneTrace.size(), true ) );
|
||||
if( expand )
|
||||
{
|
||||
for( auto& v : zoneTrace )
|
||||
{
|
||||
const auto& srcloc = m_worker.GetSourceLocation( v->srcloc );
|
||||
const auto txt = srcloc.name.active ? m_worker.GetString( srcloc.name ) : m_worker.GetString( srcloc.function );
|
||||
ImGui::Text( "%s", txt );
|
||||
ImGui::SameLine();
|
||||
ImGui::TextDisabled( "%s:%i", m_worker.GetString( srcloc.file ), srcloc.line );
|
||||
}
|
||||
ImGui::TreePop();
|
||||
}
|
||||
}
|
||||
|
||||
auto ctt = std::make_unique<uint64_t[]>( ev.child.size() );
|
||||
auto cti = std::make_unique<uint32_t[]>( ev.child.size() );
|
||||
uint64_t ctime = 0;
|
||||
@ -2562,6 +2590,34 @@ void View::DrawGpuInfoWindow()
|
||||
ImGui::Text( "CPU command setup time: %s", TimeToString( ev.cpuEnd - ev.cpuStart ) );
|
||||
ImGui::Text( "Delay to execution: %s", TimeToString( ev.gpuStart - ev.cpuStart ) );
|
||||
|
||||
ImGui::Separator();
|
||||
|
||||
std::vector<const GpuEvent*> zoneTrace;
|
||||
auto parent = GetZoneParent( ev );
|
||||
while( parent )
|
||||
{
|
||||
zoneTrace.emplace_back( parent );
|
||||
parent = GetZoneParent( *parent );
|
||||
}
|
||||
if( !zoneTrace.empty() )
|
||||
{
|
||||
bool expand = ImGui::TreeNode( "Zone trace" );
|
||||
ImGui::SameLine();
|
||||
ImGui::TextDisabled( "(%s)", RealToString( zoneTrace.size(), true ) );
|
||||
if( expand )
|
||||
{
|
||||
for( auto& v : zoneTrace )
|
||||
{
|
||||
const auto& srcloc = m_worker.GetSourceLocation( v->srcloc );
|
||||
const auto txt = srcloc.name.active ? m_worker.GetString( srcloc.name ) : m_worker.GetString( srcloc.function );
|
||||
ImGui::Text( "%s", txt );
|
||||
ImGui::SameLine();
|
||||
ImGui::TextDisabled( "%s:%i", m_worker.GetString( srcloc.file ), srcloc.line );
|
||||
}
|
||||
ImGui::TreePop();
|
||||
}
|
||||
}
|
||||
|
||||
auto ctt = std::make_unique<uint64_t[]>( ev.child.size() );
|
||||
auto cti = std::make_unique<uint32_t[]>( ev.child.size() );
|
||||
uint64_t ctime = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user