summaryrefslogtreecommitdiff
path: root/indra/llcommon/llprofiler.h
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2021-10-25 21:11:03 +0000
committerDave Parks <davep@lindenlab.com>2021-10-25 21:11:03 +0000
commit647d0224d321c706ba5936905db4265becde9d8e (patch)
tree3a9e1ddcd167d443c6f4e702b61cf68d522e704e /indra/llcommon/llprofiler.h
parenta5b1c013542d93be3b4cac820f32000fa5e3cfd4 (diff)
SL-16243 Add Tracy timers to global new/delete overrides.
Diffstat (limited to 'indra/llcommon/llprofiler.h')
-rw-r--r--indra/llcommon/llprofiler.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/indra/llcommon/llprofiler.h b/indra/llcommon/llprofiler.h
index 49510df913..e36f693dd3 100644
--- a/indra/llcommon/llprofiler.h
+++ b/indra/llcommon/llprofiler.h
@@ -36,6 +36,8 @@
#define LL_PROFILER_CONFIGURATION LL_PROFILER_CONFIG_FAST_TIMER
#endif
+extern thread_local bool gProfilerEnabled;
+
#if defined(LL_PROFILER_CONFIGURATION) && (LL_PROFILER_CONFIGURATION > LL_PROFILER_CONFIG_NONE)
#if LL_PROFILER_CONFIGURATION == LL_PROFILER_CONFIG_TRACY || LL_PROFILER_CONFIGURATION == LL_PROFILER_CONFIG_TRACY_FAST_TIMER
#define TRACY_ENABLE 1
@@ -52,7 +54,7 @@
#if LL_PROFILER_CONFIGURATION == LL_PROFILER_CONFIG_TRACY
#define LL_PROFILER_FRAME_END FrameMark
- #define LL_PROFILER_SET_THREAD_NAME( name ) tracy::SetThreadName( name )
+ #define LL_PROFILER_SET_THREAD_NAME( name ) tracy::SetThreadName( name ); gProfilerEnabled = true;
#define LL_RECORD_BLOCK_TIME(name) ZoneScoped // Want descriptive names; was: ZoneNamedN( ___tracy_scoped_zone, #name, true );
#define LL_PROFILE_ZONE_NAMED(name) ZoneNamedN( ___tracy_scoped_zone, name, true );
#define LL_PROFILE_ZONE_NAMED_COLOR(name,color) ZoneNamedNC( ___tracy_scopped_zone, name, color, true ) // RGB
@@ -82,7 +84,7 @@
#endif
#if LL_PROFILER_CONFIGURATION == LL_PROFILER_CONFIG_TRACY_FAST_TIMER
#define LL_PROFILER_FRAME_END FrameMark
- #define LL_PROFILER_SET_THREAD_NAME( name ) tracy::SetThreadName( name )
+ #define LL_PROFILER_SET_THREAD_NAME( name ) tracy::SetThreadName( name ); gProfilerEnabled = true;
#define LL_RECORD_BLOCK_TIME(name) ZoneScoped const LLTrace::BlockTimer& LL_GLUE_TOKENS(block_time_recorder, __LINE__)(LLTrace::timeThisBlock(name)); (void)LL_GLUE_TOKENS(block_time_recorder, __LINE__);
#define LL_PROFILE_ZONE_NAMED(name) ZoneNamedN( ___tracy_scoped_zone, #name, true );
#define LL_PROFILE_ZONE_NAMED_COLOR(name,color) ZoneNamedNC( ___tracy_scopped_zone, name, color, true ) // RGB