From 0331d548d22cb8555c03a3feee59804655223a2b Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Mon, 18 Sep 2017 19:08:54 +0200 Subject: [PATCH] Automatically create profiler instance. --- client/Tracy.hpp | 9 +++++++++ client/TracyProfiler.cpp | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/client/Tracy.hpp b/client/Tracy.hpp index ee5fd7b4..c8b87937 100755 --- a/client/Tracy.hpp +++ b/client/Tracy.hpp @@ -1,6 +1,13 @@ #ifndef __TRACY_HPP__ #define __TRACY_HPP__ +#ifdef TRACY_DISABLE + +#define ZoneScoped +#define FrameMark + +#else + #include "TracyProfiler.hpp" #include "TracyScoped.hpp" @@ -8,3 +15,5 @@ #define FrameMark tracy::Profiler::FrameMark(); #endif + +#endif diff --git a/client/TracyProfiler.cpp b/client/TracyProfiler.cpp index 4fba38e2..e96686a9 100755 --- a/client/TracyProfiler.cpp +++ b/client/TracyProfiler.cpp @@ -32,6 +32,10 @@ static moodycamel::ProducerToken& GetToken() extern const char* PointerCheckA; const char* PointerCheckB = "tracy"; +#ifndef TRACY_DISABLE +Profiler s_profiler; +#endif + static Profiler* s_instance = nullptr; Profiler::Profiler()