From 1a8518dcc276d12fc95072eff2c1663a69382528 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Mon, 14 Jan 2019 22:12:45 +0100 Subject: [PATCH] Allow filtering zones in on-demand mode. --- client/TracyProfiler.cpp | 4 ++-- client/TracyScoped.hpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/client/TracyProfiler.cpp b/client/TracyProfiler.cpp index 88b147e9..4f1b055e 100644 --- a/client/TracyProfiler.cpp +++ b/client/TracyProfiler.cpp @@ -1746,7 +1746,7 @@ TracyCZoneCtx ___tracy_emit_zone_begin( const struct ___tracy_source_location_da { ___tracy_c_zone_context ctx; #ifdef TRACY_ON_DEMAND - ctx.active = tracy::s_profiler.IsConnected(); + ctx.active = active && tracy::s_profiler.IsConnected(); #else ctx.active = active; #endif @@ -1773,7 +1773,7 @@ TracyCZoneCtx ___tracy_emit_zone_begin_callstack( const struct ___tracy_source_l { ___tracy_c_zone_context ctx; #ifdef TRACY_ON_DEMAND - ctx.active = tracy::s_profiler.IsConnected(); + ctx.active = active && tracy::s_profiler.IsConnected(); #else ctx.active = active; #endif diff --git a/client/TracyScoped.hpp b/client/TracyScoped.hpp index 8d08eee7..ad5905de 100644 --- a/client/TracyScoped.hpp +++ b/client/TracyScoped.hpp @@ -17,7 +17,7 @@ class ScopedZone public: tracy_force_inline ScopedZone( const SourceLocationData* srcloc, bool is_active = true ) #ifdef TRACY_ON_DEMAND - : m_active( s_profiler.IsConnected() ) + : m_active( is_active && s_profiler.IsConnected() ) #else : m_active( is_active ) #endif @@ -44,7 +44,7 @@ public: tracy_force_inline ScopedZone( const SourceLocationData* srcloc, int depth, bool is_active = true ) #ifdef TRACY_ON_DEMAND - : m_active( s_profiler.IsConnected() ) + : m_active( is_active && s_profiler.IsConnected() ) #else : m_active( is_active ) #endif