mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-27 00:04:35 +00:00
Always count source location zones.
This commit is contained in:
parent
4456c8a454
commit
ccc5c37af5
@ -1230,6 +1230,8 @@ uint32_t Worker::NewShrinkedSourceLocation( uint64_t srcloc )
|
|||||||
m_data.sourceLocationExpand.push_back( srcloc );
|
m_data.sourceLocationExpand.push_back( srcloc );
|
||||||
#ifndef TRACY_NO_STATISTICS
|
#ifndef TRACY_NO_STATISTICS
|
||||||
m_data.sourceLocationZones.emplace( sz, SourceLocationZones() );
|
m_data.sourceLocationZones.emplace( sz, SourceLocationZones() );
|
||||||
|
#else
|
||||||
|
m_data.sourceLocationZonesCnt.emplace( sz, 0 );
|
||||||
#endif
|
#endif
|
||||||
m_sourceLocationShrink.emplace( srcloc, sz );
|
m_sourceLocationShrink.emplace( srcloc, sz );
|
||||||
return sz;
|
return sz;
|
||||||
@ -1299,6 +1301,10 @@ void Worker::NewZone( ZoneEvent* zone, uint64_t thread )
|
|||||||
auto it = m_data.sourceLocationZones.find( zone->srcloc );
|
auto it = m_data.sourceLocationZones.find( zone->srcloc );
|
||||||
assert( it != m_data.sourceLocationZones.end() );
|
assert( it != m_data.sourceLocationZones.end() );
|
||||||
it->second.zones.push_back( ZoneThreadData { zone, CompressThread( thread ) } );
|
it->second.zones.push_back( ZoneThreadData { zone, CompressThread( thread ) } );
|
||||||
|
#else
|
||||||
|
auto it = m_data.sourceLocationZonesCnt.find( zone->srcloc );
|
||||||
|
assert( it != m_data.sourceLocationZonesCnt.end() );
|
||||||
|
it->second++;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
auto td = NoticeThread( thread );
|
auto td = NoticeThread( thread );
|
||||||
@ -1435,6 +1441,8 @@ void Worker::AddSourceLocationPayload( uint64_t ptr, char* data, size_t sz )
|
|||||||
m_data.sourceLocationPayload.push_back( slptr );
|
m_data.sourceLocationPayload.push_back( slptr );
|
||||||
#ifndef TRACY_NO_STATISTICS
|
#ifndef TRACY_NO_STATISTICS
|
||||||
m_data.sourceLocationZones.emplace( -int32_t( idx + 1 ), SourceLocationZones() );
|
m_data.sourceLocationZones.emplace( -int32_t( idx + 1 ), SourceLocationZones() );
|
||||||
|
#else
|
||||||
|
m_data.sourceLocationZonesCnt.emplace( -int32_t( idx + 1 ), 0 );
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -2598,6 +2606,10 @@ void Worker::ReadTimelineUpdateStatistics( ZoneEvent* zone, uint16_t thread )
|
|||||||
it->second.selfTotal += timeSpan;
|
it->second.selfTotal += timeSpan;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
auto it = m_data.sourceLocationZonesCnt.find( zone->srcloc );
|
||||||
|
assert( it != m_data.sourceLocationZonesCnt.end() );
|
||||||
|
it->second++;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -110,6 +110,8 @@ private:
|
|||||||
#ifndef TRACY_NO_STATISTICS
|
#ifndef TRACY_NO_STATISTICS
|
||||||
flat_hash_map<int32_t, SourceLocationZones, nohash<int32_t>> sourceLocationZones;
|
flat_hash_map<int32_t, SourceLocationZones, nohash<int32_t>> sourceLocationZones;
|
||||||
bool sourceLocationZonesReady;
|
bool sourceLocationZonesReady;
|
||||||
|
#else
|
||||||
|
flat_hash_map<int32_t, uint64_t> sourceLocationZonesCnt;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
flat_hash_map<VarArray<uint64_t>*, uint32_t, VarArrayHasherPOT<uint64_t>, VarArrayComparator<uint64_t>> callstackMap;
|
flat_hash_map<VarArray<uint64_t>*, uint32_t, VarArrayHasherPOT<uint64_t>, VarArrayComparator<uint64_t>> callstackMap;
|
||||||
|
Loading…
Reference in New Issue
Block a user