mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-27 00:04:35 +00:00
Allow grouping zones by parent.
This commit is contained in:
parent
c0df3dd965
commit
978071f2ba
@ -7601,6 +7601,11 @@ uint64_t View::GetSelectionTarget( const Worker::ZoneThreadData& ev, FindZone::G
|
|||||||
return ev.Zone()->text.Active() ? ev.Zone()->text.Idx() : std::numeric_limits<uint64_t>::max();
|
return ev.Zone()->text.Active() ? ev.Zone()->text.Idx() : std::numeric_limits<uint64_t>::max();
|
||||||
case FindZone::GroupBy::Callstack:
|
case FindZone::GroupBy::Callstack:
|
||||||
return ev.Zone()->callstack.Val();
|
return ev.Zone()->callstack.Val();
|
||||||
|
case FindZone::GroupBy::Parent:
|
||||||
|
{
|
||||||
|
const auto parent = GetZoneParent( *ev.Zone(), m_worker.DecompressThread( ev.Thread() ) );
|
||||||
|
return parent ? uint64_t( parent->SrcLoc() ) : 0;
|
||||||
|
}
|
||||||
case FindZone::GroupBy::NoGrouping:
|
case FindZone::GroupBy::NoGrouping:
|
||||||
return 0;
|
return 0;
|
||||||
default:
|
default:
|
||||||
@ -8561,6 +8566,8 @@ void View::DrawFindZone()
|
|||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
groupChanged |= ImGui::RadioButton( "Call stacks", (int*)( &m_findZone.groupBy ), (int)FindZone::GroupBy::Callstack );
|
groupChanged |= ImGui::RadioButton( "Call stacks", (int*)( &m_findZone.groupBy ), (int)FindZone::GroupBy::Callstack );
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
|
groupChanged |= ImGui::RadioButton( "Parent", (int*)( &m_findZone.groupBy ), (int)FindZone::GroupBy::Parent );
|
||||||
|
ImGui::SameLine();
|
||||||
groupChanged |= ImGui::RadioButton( "No grouping", (int*)( &m_findZone.groupBy ), (int)FindZone::GroupBy::NoGrouping );
|
groupChanged |= ImGui::RadioButton( "No grouping", (int*)( &m_findZone.groupBy ), (int)FindZone::GroupBy::NoGrouping );
|
||||||
if( groupChanged )
|
if( groupChanged )
|
||||||
{
|
{
|
||||||
@ -8635,6 +8642,19 @@ void View::DrawFindZone()
|
|||||||
case FindZone::GroupBy::Callstack:
|
case FindZone::GroupBy::Callstack:
|
||||||
group = &m_findZone.groups[ev.Zone()->callstack.Val()];
|
group = &m_findZone.groups[ev.Zone()->callstack.Val()];
|
||||||
break;
|
break;
|
||||||
|
case FindZone::GroupBy::Parent:
|
||||||
|
{
|
||||||
|
const auto parent = GetZoneParent( *ev.Zone(), m_worker.DecompressThread( ev.Thread() ) );
|
||||||
|
if( parent )
|
||||||
|
{
|
||||||
|
group = &m_findZone.groups[uint64_t( parent->SrcLoc() )];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
group = &m_findZone.groups[0];
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
case FindZone::GroupBy::NoGrouping:
|
case FindZone::GroupBy::NoGrouping:
|
||||||
group = &m_findZone.groups[0];
|
group = &m_findZone.groups[0];
|
||||||
break;
|
break;
|
||||||
@ -8828,6 +8848,17 @@ void View::DrawFindZone()
|
|||||||
hdrString = m_worker.GetString( frameData.data[frameData.size-1].name );
|
hdrString = m_worker.GetString( frameData.data[frameData.size-1].name );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case FindZone::GroupBy::Parent:
|
||||||
|
if( v->first == 0 )
|
||||||
|
{
|
||||||
|
hdrString = "<no parent>";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
auto srcloc = m_worker.GetSourceLocation( int16_t( v->first ) );
|
||||||
|
hdrString = m_worker.GetString( srcloc.name.active ? srcloc.name : srcloc.function );
|
||||||
|
}
|
||||||
|
break;
|
||||||
case FindZone::GroupBy::NoGrouping:
|
case FindZone::GroupBy::NoGrouping:
|
||||||
hdrString = "Zone list";
|
hdrString = "Zone list";
|
||||||
break;
|
break;
|
||||||
|
@ -380,7 +380,7 @@ private:
|
|||||||
|
|
||||||
struct FindZone {
|
struct FindZone {
|
||||||
enum : uint64_t { Unselected = std::numeric_limits<uint64_t>::max() - 1 };
|
enum : uint64_t { Unselected = std::numeric_limits<uint64_t>::max() - 1 };
|
||||||
enum class GroupBy : int { Thread, UserText, Callstack, NoGrouping };
|
enum class GroupBy : int { Thread, UserText, Callstack, Parent, NoGrouping };
|
||||||
enum class SortBy : int { Order, Count, Time, Mtpc };
|
enum class SortBy : int { Order, Count, Time, Mtpc };
|
||||||
enum class TableSortBy : int { Starttime, Runtime, Name };
|
enum class TableSortBy : int { Starttime, Runtime, Name };
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user