From 010b19946fc61fc35875ecf729846733fcf8b16c Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Tue, 10 Jul 2018 21:44:23 +0200 Subject: [PATCH] Send on-demand status in welcome message. --- client/TracyProfiler.cpp | 7 +++++++ common/TracyProtocol.hpp | 1 + 2 files changed, 8 insertions(+) diff --git a/client/TracyProfiler.cpp b/client/TracyProfiler.cpp index 886aab23..aca574d5 100644 --- a/client/TracyProfiler.cpp +++ b/client/TracyProfiler.cpp @@ -257,6 +257,12 @@ void Profiler::Worker() while( m_timeBegin.load( std::memory_order_relaxed ) == 0 ) std::this_thread::sleep_for( std::chrono::milliseconds( 10 ) ); +#ifdef TRACY_ON_DEMAND + uint8_t onDemand = 1; +#else + uint8_t onDemand = 0; +#endif + WelcomeMessage welcome; MemWrite( &welcome.timerMul, m_timerMul ); MemWrite( &welcome.initBegin, s_initTime.val ); @@ -264,6 +270,7 @@ void Profiler::Worker() MemWrite( &welcome.delay, m_delay ); MemWrite( &welcome.resolution, m_resolution ); MemWrite( &welcome.epoch, m_epoch ); + MemWrite( &welcome.onDemand, onDemand ); memcpy( welcome.programName, procname, pnsz ); memset( welcome.programName + pnsz, 0, WelcomeMessageProgramNameSize - pnsz ); diff --git a/common/TracyProtocol.hpp b/common/TracyProtocol.hpp index 5b94b501..e89cc8a2 100644 --- a/common/TracyProtocol.hpp +++ b/common/TracyProtocol.hpp @@ -36,6 +36,7 @@ struct WelcomeMessage uint64_t delay; uint64_t resolution; uint64_t epoch; + uint8_t onDemand; char programName[WelcomeMessageProgramNameSize]; };