mirror of
https://github.com/wolfpld/tracy.git
synced 2024-12-02 09:44:35 +00:00
Add inclusive time display to time distribution.
This commit is contained in:
parent
1032eb95d2
commit
115c66324d
@ -5589,11 +5589,14 @@ template<typename Adapter, typename V>
|
|||||||
void View::CalcZoneTimeDataImpl( const V& children, flat_hash_map<int16_t, ZoneTimeData, nohash<uint16_t>>& data, flat_hash_map<int16_t, ZoneTimeData, nohash<uint16_t>>::iterator zit, const ZoneEvent& zone )
|
void View::CalcZoneTimeDataImpl( const V& children, flat_hash_map<int16_t, ZoneTimeData, nohash<uint16_t>>& data, flat_hash_map<int16_t, ZoneTimeData, nohash<uint16_t>>::iterator zit, const ZoneEvent& zone )
|
||||||
{
|
{
|
||||||
Adapter a;
|
Adapter a;
|
||||||
|
if( m_timeDist.exclusiveTime )
|
||||||
|
{
|
||||||
for( auto& child : children )
|
for( auto& child : children )
|
||||||
{
|
{
|
||||||
const auto t = m_worker.GetZoneEnd( a(child) ) - a(child).Start();
|
const auto t = m_worker.GetZoneEnd( a(child) ) - a(child).Start();
|
||||||
zit->second.time -= t;
|
zit->second.time -= t;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
for( auto& child : children )
|
for( auto& child : children )
|
||||||
{
|
{
|
||||||
const auto srcloc = a(child).SrcLoc();
|
const auto srcloc = a(child).SrcLoc();
|
||||||
@ -5630,6 +5633,8 @@ template<typename Adapter, typename V>
|
|||||||
void View::CalcZoneTimeDataImpl( const V& children, const ContextSwitch* ctx, flat_hash_map<int16_t, ZoneTimeData, nohash<uint16_t>>& data, flat_hash_map<int16_t, ZoneTimeData, nohash<uint16_t>>::iterator zit, const ZoneEvent& zone )
|
void View::CalcZoneTimeDataImpl( const V& children, const ContextSwitch* ctx, flat_hash_map<int16_t, ZoneTimeData, nohash<uint16_t>>& data, flat_hash_map<int16_t, ZoneTimeData, nohash<uint16_t>>::iterator zit, const ZoneEvent& zone )
|
||||||
{
|
{
|
||||||
Adapter a;
|
Adapter a;
|
||||||
|
if( m_timeDist.exclusiveTime )
|
||||||
|
{
|
||||||
for( auto& child : children )
|
for( auto& child : children )
|
||||||
{
|
{
|
||||||
int64_t t;
|
int64_t t;
|
||||||
@ -5638,6 +5643,7 @@ void View::CalcZoneTimeDataImpl( const V& children, const ContextSwitch* ctx, fl
|
|||||||
assert( res );
|
assert( res );
|
||||||
zit->second.time -= t;
|
zit->second.time -= t;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
for( auto& child : children )
|
for( auto& child : children )
|
||||||
{
|
{
|
||||||
const auto srcloc = a(child).SrcLoc();
|
const auto srcloc = a(child).SrcLoc();
|
||||||
@ -6302,6 +6308,8 @@ void View::DrawZoneInfoWindow()
|
|||||||
bool expand = ImGui::TreeNode( "Time distribution" );
|
bool expand = ImGui::TreeNode( "Time distribution" );
|
||||||
if( expand )
|
if( expand )
|
||||||
{
|
{
|
||||||
|
ImGui::SameLine();
|
||||||
|
if( SmallCheckbox( "Exclusive time", &m_timeDist.exclusiveTime ) ) m_timeDist.dataValidFor = nullptr;
|
||||||
if( ctx )
|
if( ctx )
|
||||||
{
|
{
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
|
@ -603,6 +603,7 @@ private:
|
|||||||
enum class SortBy : int { Count, Time, Mtpc };
|
enum class SortBy : int { Count, Time, Mtpc };
|
||||||
SortBy sortBy = SortBy::Time;
|
SortBy sortBy = SortBy::Time;
|
||||||
bool runningTime = false;
|
bool runningTime = false;
|
||||||
|
bool exclusiveTime = true;
|
||||||
flat_hash_map<int16_t, ZoneTimeData, nohash<uint16_t>> data;
|
flat_hash_map<int16_t, ZoneTimeData, nohash<uint16_t>> data;
|
||||||
const ZoneEvent* dataValidFor = nullptr;
|
const ZoneEvent* dataValidFor = nullptr;
|
||||||
float fztime;
|
float fztime;
|
||||||
|
Loading…
Reference in New Issue
Block a user