From 8a6e4d2971fcd67beb14526e471c2b6bd53ebf81 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Mon, 16 Oct 2017 21:34:39 +0200 Subject: [PATCH] Change TRACY_DISABLE to TRACY_ENABLE. By default tracy is now disabled. --- Tracy.hpp | 2 +- TracyClient.cpp | 6 ++++++ client/TracyProfiler.cpp | 6 ++++-- client/tracy_rpmalloc.cpp | 6 +++++- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/Tracy.hpp b/Tracy.hpp index e9c8f4ee..31326b5c 100644 --- a/Tracy.hpp +++ b/Tracy.hpp @@ -1,7 +1,7 @@ #ifndef __TRACY_HPP__ #define __TRACY_HPP__ -#ifdef TRACY_DISABLE +#ifndef TRACY_ENABLE #define ZoneScoped #define ZoneScopedC(x) diff --git a/TracyClient.cpp b/TracyClient.cpp index 9f188d22..17a8736d 100644 --- a/TracyClient.cpp +++ b/TracyClient.cpp @@ -7,6 +7,10 @@ // other). // +// Define TRACY_ENABLE to enable profiler. + +#ifdef TRACY_ENABLE + #include "client/TracyProfiler.cpp" #include "common/tracy_lz4.cpp" #include "common/TracySocket.cpp" @@ -16,3 +20,5 @@ #ifdef _MSC_VER # pragma comment(lib, "ws2_32.lib") #endif + +#endif diff --git a/client/TracyProfiler.cpp b/client/TracyProfiler.cpp index c6654595..21f85878 100644 --- a/client/TracyProfiler.cpp +++ b/client/TracyProfiler.cpp @@ -1,3 +1,5 @@ +#ifdef TRACY_ENABLE + #ifdef _MSC_VER # include # include @@ -73,9 +75,7 @@ static moodycamel::ConcurrentQueue init_order(103) s_queue( QueuePrea static thread_local moodycamel::ProducerToken init_order(104) s_token_detail( s_queue ); thread_local ProducerWrapper init_order(105) s_token { s_queue.get_explicit_producer( s_token_detail ) }; -#ifndef TRACY_DISABLE static Profiler init_order(106) s_profiler; -#endif static Profiler* s_instance = nullptr; static Thread* s_thread = nullptr; @@ -424,3 +424,5 @@ void Profiler::CalibrateDelay() } } + +#endif diff --git a/client/tracy_rpmalloc.cpp b/client/tracy_rpmalloc.cpp index b7ced4a6..83ea6e68 100644 --- a/client/tracy_rpmalloc.cpp +++ b/client/tracy_rpmalloc.cpp @@ -1,3 +1,5 @@ +#ifdef TRACY_ENABLE + /* rpmalloc.c - Memory allocator - Public Domain - 2016 Mattias Jansson / Rampant Pixels * * This library provides a cross-platform lock free thread caching malloc implementation in C11. @@ -1782,4 +1784,6 @@ rpmalloc_global_statistics(rpmalloc_global_statistics_t* stats) { } } -} \ No newline at end of file +} + +#endif