From ccc5c37af5d3d746efdb0a5b74a9d4c9f00c7c41 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sun, 29 Jul 2018 14:16:13 +0200 Subject: [PATCH] Always count source location zones. --- server/TracyWorker.cpp | 12 ++++++++++++ server/TracyWorker.hpp | 2 ++ 2 files changed, 14 insertions(+) diff --git a/server/TracyWorker.cpp b/server/TracyWorker.cpp index 3dce301d..04583ca3 100644 --- a/server/TracyWorker.cpp +++ b/server/TracyWorker.cpp @@ -1230,6 +1230,8 @@ uint32_t Worker::NewShrinkedSourceLocation( uint64_t srcloc ) m_data.sourceLocationExpand.push_back( srcloc ); #ifndef TRACY_NO_STATISTICS m_data.sourceLocationZones.emplace( sz, SourceLocationZones() ); +#else + m_data.sourceLocationZonesCnt.emplace( sz, 0 ); #endif m_sourceLocationShrink.emplace( srcloc, sz ); return sz; @@ -1299,6 +1301,10 @@ void Worker::NewZone( ZoneEvent* zone, uint64_t thread ) auto it = m_data.sourceLocationZones.find( zone->srcloc ); assert( it != m_data.sourceLocationZones.end() ); 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 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 ); #ifndef TRACY_NO_STATISTICS m_data.sourceLocationZones.emplace( -int32_t( idx + 1 ), SourceLocationZones() ); +#else + m_data.sourceLocationZonesCnt.emplace( -int32_t( idx + 1 ), 0 ); #endif } else @@ -2598,6 +2606,10 @@ void Worker::ReadTimelineUpdateStatistics( ZoneEvent* zone, uint16_t thread ) it->second.selfTotal += timeSpan; } } +#else + auto it = m_data.sourceLocationZonesCnt.find( zone->srcloc ); + assert( it != m_data.sourceLocationZonesCnt.end() ); + it->second++; #endif } diff --git a/server/TracyWorker.hpp b/server/TracyWorker.hpp index 5236b0ae..ec91fcf5 100644 --- a/server/TracyWorker.hpp +++ b/server/TracyWorker.hpp @@ -110,6 +110,8 @@ private: #ifndef TRACY_NO_STATISTICS flat_hash_map> sourceLocationZones; bool sourceLocationZonesReady; +#else + flat_hash_map sourceLocationZonesCnt; #endif flat_hash_map*, uint32_t, VarArrayHasherPOT, VarArrayComparator> callstackMap;