mirror of
https://github.com/wolfpld/tracy
synced 2025-05-01 13:13:53 +00:00
Implement grouping zones by zone name.
This commit is contained in:
parent
1975c1897d
commit
925bf7e638
@ -8730,6 +8730,13 @@ uint64_t View::GetSelectionTarget( const Worker::ZoneThreadData& ev, FindZone::G
|
|||||||
const auto& extra = m_worker.GetZoneExtra( zone );
|
const auto& extra = m_worker.GetZoneExtra( zone );
|
||||||
return extra.text.Active() ? extra.text.Idx() : std::numeric_limits<uint64_t>::max();
|
return extra.text.Active() ? extra.text.Idx() : std::numeric_limits<uint64_t>::max();
|
||||||
}
|
}
|
||||||
|
case FindZone::GroupBy::ZoneName:
|
||||||
|
{
|
||||||
|
const auto& zone = *ev.Zone();
|
||||||
|
if( !m_worker.HasZoneExtra( zone ) ) return std::numeric_limits<uint64_t>::max();
|
||||||
|
const auto& extra = m_worker.GetZoneExtra( zone );
|
||||||
|
return extra.name.Active() ? extra.name.Idx() : std::numeric_limits<uint64_t>::max();
|
||||||
|
}
|
||||||
case FindZone::GroupBy::Callstack:
|
case FindZone::GroupBy::Callstack:
|
||||||
return m_worker.GetZoneExtra( *ev.Zone() ).callstack.Val();
|
return m_worker.GetZoneExtra( *ev.Zone() ).callstack.Val();
|
||||||
case FindZone::GroupBy::Parent:
|
case FindZone::GroupBy::Parent:
|
||||||
@ -9875,6 +9882,8 @@ void View::DrawFindZone()
|
|||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
groupChanged |= ImGui::RadioButton( "User text", (int*)( &m_findZone.groupBy ), (int)FindZone::GroupBy::UserText );
|
groupChanged |= ImGui::RadioButton( "User text", (int*)( &m_findZone.groupBy ), (int)FindZone::GroupBy::UserText );
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
|
groupChanged |= ImGui::RadioButton( "Zone name", (int*)( &m_findZone.groupBy ), (int)FindZone::GroupBy::ZoneName );
|
||||||
|
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 );
|
groupChanged |= ImGui::RadioButton( "Parent", (int*)( &m_findZone.groupBy ), (int)FindZone::GroupBy::Parent );
|
||||||
@ -9965,6 +9974,20 @@ void View::DrawFindZone()
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case FindZone::GroupBy::ZoneName:
|
||||||
|
{
|
||||||
|
const auto& zone = *ev.Zone();
|
||||||
|
if( !m_worker.HasZoneExtra( zone ) )
|
||||||
|
{
|
||||||
|
gid = std::numeric_limits<uint64_t>::max();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
const auto& extra = m_worker.GetZoneExtra( zone );
|
||||||
|
gid = extra.name.Active() ? extra.name.Idx() : std::numeric_limits<uint64_t>::max();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
case FindZone::GroupBy::Callstack:
|
case FindZone::GroupBy::Callstack:
|
||||||
gid = m_worker.GetZoneExtra( *ev.Zone() ).callstack.Val();
|
gid = m_worker.GetZoneExtra( *ev.Zone() ).callstack.Val();
|
||||||
break;
|
break;
|
||||||
@ -10150,6 +10173,17 @@ void View::DrawFindZone()
|
|||||||
case FindZone::GroupBy::UserText:
|
case FindZone::GroupBy::UserText:
|
||||||
hdrString = v->first == std::numeric_limits<uint64_t>::max() ? "No user text" : m_worker.GetString( StringIdx( v->first ) );
|
hdrString = v->first == std::numeric_limits<uint64_t>::max() ? "No user text" : m_worker.GetString( StringIdx( v->first ) );
|
||||||
break;
|
break;
|
||||||
|
case FindZone::GroupBy::ZoneName:
|
||||||
|
if( v->first == std::numeric_limits<uint64_t>::max() )
|
||||||
|
{
|
||||||
|
auto& srcloc = m_worker.GetSourceLocation( m_findZone.match[m_findZone.selMatch] );
|
||||||
|
hdrString = m_worker.GetString( srcloc.name.active ? srcloc.name : srcloc.function );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
hdrString = m_worker.GetString( StringIdx( v->first ) );
|
||||||
|
}
|
||||||
|
break;
|
||||||
case FindZone::GroupBy::Callstack:
|
case FindZone::GroupBy::Callstack:
|
||||||
if( v->first == 0 )
|
if( v->first == 0 )
|
||||||
{
|
{
|
||||||
|
@ -439,7 +439,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, Parent, NoGrouping };
|
enum class GroupBy : int { Thread, UserText, ZoneName, 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…
x
Reference in New Issue
Block a user