From 6e8bb9e490333cc38ac1a105bb1d601b5eea785c Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Fri, 16 Feb 2018 14:42:16 +0100 Subject: [PATCH] Display bin times. --- server/TracyView.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 8b7215bd..d4e2b905 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -4216,6 +4216,9 @@ void View::DrawFindZone() auto bins = std::make_unique( numBins ); memset( bins.get(), 0, sizeof( uint64_t ) * numBins ); + auto binTime = std::make_unique( numBins ); + memset( binTime.get(), 0, sizeof( int64_t ) * numBins ); + const auto idt = numBins / dt; for( auto& v : m_findZone.result ) @@ -4225,6 +4228,7 @@ void View::DrawFindZone() const auto timeSpan = GetZoneEnd( *ev ) - ev->start; const auto bin = std::min( numBins - 1, int64_t( ( timeSpan - tmin ) * idt ) ); bins[bin]++; + binTime[bin] += timeSpan; } } @@ -4266,9 +4270,24 @@ void View::DrawFindZone() const auto t0 = int64_t( tmin + bin / numBins * ( tmax - tmin ) ); const auto t1 = int64_t( tmin + (bin+1) / numBins * ( tmax - tmin ) ); + int64_t tBefore = 0; + for( int i=0; i