From 9678cc8afc9ce8ed3e3e3011e21faccbde375183 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Fri, 16 Feb 2018 13:28:40 +0100 Subject: [PATCH] Support logarithmic scaling of values on search histogram. --- server/TracyView.cpp | 26 +++++++++++++++++++++----- server/TracyView.hpp | 1 + 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 91f88419..94813e56 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -4190,6 +4190,8 @@ void View::DrawFindZone() } } + ImGui::Checkbox( "Log values", &m_findZone.logVal ); + ImGui::Text( "tMin: %s", TimeToString( tmin ) ); ImGui::Text( "tMax: %s", TimeToString( tmax ) ); @@ -4231,13 +4233,27 @@ void View::DrawFindZone() maxVal = std::max( maxVal, bins[i] ); } - const auto hAdj = double( Height - 4 ) / maxVal; - - for( int i=0; i 0 ) + const auto hAdj = double( Height - 4 ) / log10( maxVal + 1 ); + for( int i=0; iAddLine( wpos + ImVec2( 2+i, Height-3 ), wpos + ImVec2( 2+i, Height-3 - bins[i] * hAdj ), 0xFF22DDDD ); + if( bins[i] > 0 ) + { + draw->AddLine( wpos + ImVec2( 2+i, Height-3 ), wpos + ImVec2( 2+i, Height-3 - log10( bins[i] + 1 ) * hAdj ), 0xFF22DDDD ); + } + } + + } + else + { + const auto hAdj = double( Height - 4 ) / maxVal; + for( int i=0; i 0 ) + { + draw->AddLine( wpos + ImVec2( 2+i, Height-3 ), wpos + ImVec2( 2+i, Height-3 - bins[i] * hAdj ), 0xFF22DDDD ); + } } } } diff --git a/server/TracyView.hpp b/server/TracyView.hpp index 11483f1e..e57f840d 100644 --- a/server/TracyView.hpp +++ b/server/TracyView.hpp @@ -288,6 +288,7 @@ private: char pattern[1024] = { "" }; int maxZonesPerThread = 1000; int maxDepth = 10; + bool logVal = false; } m_findZone; bool m_terminate;