mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-26 16:04:34 +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
|
struct GhostZone
|
||||||
{
|
{
|
||||||
Int48 start, end;
|
Int48 start, end;
|
||||||
CallstackFrameId frame;
|
Int24 frame;
|
||||||
int32_t child;
|
int32_t child;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1763,16 +1763,28 @@ Worker::Worker( FileRead& f, EventType::Type eventMask, bool bgTasks )
|
|||||||
do
|
do
|
||||||
{
|
{
|
||||||
auto& entry = cs[idx];
|
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() )
|
if( vec->empty() )
|
||||||
{
|
{
|
||||||
gcnt++;
|
gcnt++;
|
||||||
auto& zone = vec->push_next();
|
auto& zone = vec->push_next();
|
||||||
zone.start.SetVal( time );
|
zone.start.SetVal( time );
|
||||||
zone.end.SetVal( time + m_samplingPeriod );
|
zone.end.SetVal( time + m_samplingPeriod );
|
||||||
zone.frame = entry;
|
zone.frame.SetVal( fid );
|
||||||
zone.child = -1;
|
zone.child = -1;
|
||||||
}
|
}
|
||||||
else if( vec->back().frame == entry )
|
else if( vec->back().frame.Val() == fid )
|
||||||
{
|
{
|
||||||
auto& zone = vec->back();
|
auto& zone = vec->back();
|
||||||
zone.end.SetVal( time + m_samplingPeriod );
|
zone.end.SetVal( time + m_samplingPeriod );
|
||||||
@ -1784,7 +1796,7 @@ Worker::Worker( FileRead& f, EventType::Type eventMask, bool bgTasks )
|
|||||||
auto& zone = vec->push_next();
|
auto& zone = vec->push_next();
|
||||||
zone.start.SetVal( time );
|
zone.start.SetVal( time );
|
||||||
zone.end.SetVal( time + m_samplingPeriod );
|
zone.end.SetVal( time + m_samplingPeriod );
|
||||||
zone.frame = entry;
|
zone.frame.SetVal( fid );
|
||||||
zone.child = -1;
|
zone.child = -1;
|
||||||
}
|
}
|
||||||
if( idx > 0 )
|
if( idx > 0 )
|
||||||
|
@ -245,6 +245,8 @@ private:
|
|||||||
Vector<Vector<short_ptr<GpuEvent>>> gpuChildren;
|
Vector<Vector<short_ptr<GpuEvent>>> gpuChildren;
|
||||||
#ifndef TRACY_NO_STATISTICS
|
#ifndef TRACY_NO_STATISTICS
|
||||||
Vector<Vector<GhostZone>> ghostChildren;
|
Vector<Vector<GhostZone>> ghostChildren;
|
||||||
|
Vector<CallstackFrameId> ghostFrames;
|
||||||
|
unordered_flat_map<uint64_t, uint32_t> ghostFramesMap;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Vector<Vector<short_ptr<ZoneEvent>>> zoneVectorCache;
|
Vector<Vector<short_ptr<ZoneEvent>>> zoneVectorCache;
|
||||||
|
Loading…
Reference in New Issue
Block a user