mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-26 07:54:36 +00:00
Pack frame identifiers in ghost zones.
This commit is contained in:
parent
ead597bacc
commit
b89874850f
@ -504,7 +504,7 @@ enum { FrameImageSize = sizeof( FrameImage ) };
|
||||
struct GhostZone
|
||||
{
|
||||
Int48 start, end;
|
||||
CallstackFrameId frame;
|
||||
Int24 frame;
|
||||
int32_t child;
|
||||
};
|
||||
|
||||
|
@ -1763,16 +1763,28 @@ Worker::Worker( FileRead& f, EventType::Type eventMask, bool bgTasks )
|
||||
do
|
||||
{
|
||||
auto& entry = cs[idx];
|
||||
uint32_t fid;
|
||||
auto it = m_data.ghostFramesMap.find( entry.data );
|
||||
if( it == m_data.ghostFramesMap.end() )
|
||||
{
|
||||
fid = uint32_t( m_data.ghostFrames.size() );
|
||||
m_data.ghostFrames.push_back( entry );
|
||||
m_data.ghostFramesMap.emplace( entry.data, fid );
|
||||
}
|
||||
else
|
||||
{
|
||||
fid = it->second;
|
||||
}
|
||||
if( vec->empty() )
|
||||
{
|
||||
gcnt++;
|
||||
auto& zone = vec->push_next();
|
||||
zone.start.SetVal( time );
|
||||
zone.end.SetVal( time + m_samplingPeriod );
|
||||
zone.frame = entry;
|
||||
zone.frame.SetVal( fid );
|
||||
zone.child = -1;
|
||||
}
|
||||
else if( vec->back().frame == entry )
|
||||
else if( vec->back().frame.Val() == fid )
|
||||
{
|
||||
auto& zone = vec->back();
|
||||
zone.end.SetVal( time + m_samplingPeriod );
|
||||
@ -1784,7 +1796,7 @@ Worker::Worker( FileRead& f, EventType::Type eventMask, bool bgTasks )
|
||||
auto& zone = vec->push_next();
|
||||
zone.start.SetVal( time );
|
||||
zone.end.SetVal( time + m_samplingPeriod );
|
||||
zone.frame = entry;
|
||||
zone.frame.SetVal( fid );
|
||||
zone.child = -1;
|
||||
}
|
||||
if( idx > 0 )
|
||||
|
@ -245,6 +245,8 @@ private:
|
||||
Vector<Vector<short_ptr<GpuEvent>>> gpuChildren;
|
||||
#ifndef TRACY_NO_STATISTICS
|
||||
Vector<Vector<GhostZone>> ghostChildren;
|
||||
Vector<CallstackFrameId> ghostFrames;
|
||||
unordered_flat_map<uint64_t, uint32_t> ghostFramesMap;
|
||||
#endif
|
||||
|
||||
Vector<Vector<short_ptr<ZoneEvent>>> zoneVectorCache;
|
||||
|
Loading…
Reference in New Issue
Block a user