mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-30 01:04:36 +00:00
Calculate total time spent in source location.
This simple solution doesn't handle recursion at all.
This commit is contained in:
parent
40a14292b3
commit
a9e1a9bddb
@ -1271,6 +1271,7 @@ void Worker::ProcessZoneEnd( const QueueZoneEnd& ev )
|
||||
assert( it != m_data.sourceLocationZones.end() );
|
||||
it->second.min = std::min( it->second.min, timeSpan );
|
||||
it->second.max = std::max( it->second.max, timeSpan );
|
||||
it->second.total += timeSpan;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@ -1671,6 +1672,7 @@ void Worker::ReadTimeline( FileRead& f, Vector<ZoneEvent*>& vec, uint16_t thread
|
||||
{
|
||||
it->second.min = std::min( it->second.min, timeSpan );
|
||||
it->second.max = std::max( it->second.max, timeSpan );
|
||||
it->second.total += timeSpan;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@ -35,11 +35,16 @@ class Worker
|
||||
|
||||
struct SourceLocationZones
|
||||
{
|
||||
SourceLocationZones() : min( std::numeric_limits<int64_t>::max() ), max( std::numeric_limits<int64_t>::min() ) {}
|
||||
SourceLocationZones()
|
||||
: min( std::numeric_limits<int64_t>::max() )
|
||||
, max( std::numeric_limits<int64_t>::min() )
|
||||
, total( 0 )
|
||||
{}
|
||||
|
||||
Vector<ZoneThreadData> zones;
|
||||
int64_t min;
|
||||
int64_t max;
|
||||
int64_t total;
|
||||
};
|
||||
|
||||
struct DataBlock
|
||||
|
Loading…
Reference in New Issue
Block a user