diff --git a/indra/llcommon/llprofiler.cpp b/indra/llcommon/llprofiler.cpp
new file mode 100644
index 0000000000..be22212e50
--- /dev/null
+++ b/indra/llcommon/llprofiler.cpp
@@ -0,0 +1,31 @@
+/**
+ * @file llprofiler.cpp
+ * @brief llprofiler Telemetry abstraction
+ *
+ * $LicenseInfo:firstyear=2021&license=fsviewerlgpl$
+ * Phoenix Firestorm Viewer Source Code
+ * Copyright (C) 2021, The Phoenix Firestorm Project, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * The Phoenix Firestorm Project, Inc., 1831 Oakwood Drive, Fairmont, Minnesota 56031-3225 USA
+ * http://www.firestormviewer.org
+ * $/LicenseInfo$
+ */
+#include "llprofiler.h"
+namespace LLProfiler
+{
+ bool active{false};
+}
\ No newline at end of file
diff --git a/indra/llcommon/llprofiler.h b/indra/llcommon/llprofiler.h
index e82837fcbf..a278c70fe4 100644
--- a/indra/llcommon/llprofiler.h
+++ b/indra/llcommon/llprofiler.h
@@ -36,6 +36,12 @@
#define LL_PROFILER_CONFIGURATION LL_PROFILER_CONFIG_FAST_TIMER
#endif
+// active switch for deferred profiling
+namespace LLProfiler
+{
+ extern bool active;
+}
+//
#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
@@ -57,13 +63,19 @@
#define LL_PROFILER_SET_THREAD_NAME( name ) tracy::SetThreadName( name )
#define LL_PROFILER_THREAD_BEGIN(name) FrameMarkStart( name ) // C string
#define LL_PROFILER_THREAD_END(name) FrameMarkEnd( name ) // C string
- // revert change that obscures custom FTM zones.
- // #define LL_RECORD_BLOCK_TIME(name) ZoneScoped // Want descriptive names; was: ZoneNamedN( ___tracy_scoped_zone, #name, true );
- #define LL_RECORD_BLOCK_TIME(name) ZoneNamedN( ___tracy_scoped_zone, #name, true )
+ // revert change that obscures custom FTM zones. We may want to may FTM Zones unique in future.
+ // #define LL_RECORD_BLOCK_TIME(name) ZoneScoped // Want descriptive names; was: ZoneNamedN( ___tracy_scoped_zone, #name, LLProfiler::active );
+ #define LL_RECORD_BLOCK_TIME(name) ZoneNamedN( ___tracy_scoped_zone, #name, LLProfiler::active )
+ //
+
+ //
+ // #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
+ // #define LL_PROFILE_ZONE_SCOPED ZoneScoped
+ #define LL_PROFILE_ZONE_NAMED(name) ZoneNamedN( ___tracy_scoped_zone, name, LLProfiler::active )
+ #define LL_PROFILE_ZONE_NAMED_COLOR(name,color) ZoneNamedNC( ___tracy_scopped_zone, name, color, LLProfiler::active ) // RGB
+ #define LL_PROFILE_ZONE_SCOPED ZoneNamed( ___tracy_scoped_zone, LLProfiler::active ) // Enable deferred collection through filters
//
- #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
- #define LL_PROFILE_ZONE_SCOPED ZoneScoped
#define LL_PROFILE_ZONE_NUM( val ) ZoneValue( val )
#define LL_PROFILE_ZONE_TEXT( text, size ) ZoneText( text, size )
@@ -73,7 +85,7 @@
#define LL_PROFILE_ZONE_WARN(name) LL_PROFILE_ZONE_NAMED_COLOR( name, 0x0FFFF00 ) // RGB red
// Additional FS Tracy macros
- #define LL_PROFILE_ZONE_COLOR(color) ZoneNamedC( ___tracy_scoped_zone, color, true ) // Additional Tracy macro
+ #define LL_PROFILE_ZONE_COLOR(color) ZoneNamedC( ___tracy_scoped_zone, color, LLProfiler::active ) // Additional Tracy macro
#define LL_PROFILE_PLOT( name, value ) TracyPlot( name, value)
#define LL_PROFILE_PLOT_SQ( name, prev, value ) TracyPlot(name,prev);TracyPlot( name, value)
#define LL_PROFILE_IS_CONNECTED TracyIsConnected
@@ -114,11 +126,16 @@
// revert change that obscures custom FTM zones.
// #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_RECORD_BLOCK_TIME(name) ZoneNamedN( ___tracy_scoped_zone, #name, true ); const LLTrace::BlockTimer& LL_GLUE_TOKENS(block_time_recorder, __LINE__)(LLTrace::timeThisBlock(name)); (void)LL_GLUE_TOKENS(block_time_recorder, __LINE__);
+ #define LL_RECORD_BLOCK_TIME(name) ZoneNamedN( ___tracy_scoped_zone, #name, LLProfiler::active ); 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
+ // #define LL_PROFILE_ZONE_SCOPED ZoneScoped
+ #define LL_PROFILE_ZONE_NAMED(name) ZoneNamedN( ___tracy_scoped_zone, name, LLProfiler::active );
+ #define LL_PROFILE_ZONE_NAMED_COLOR(name,color) ZoneNamedNC( ___tracy_scopped_zone, name, color, LLProfiler::active ) // RGB
+ #define LL_PROFILE_ZONE_SCOPED ZoneNamed( ___tracy_scoped_zone, LLProfiler::active ) // Enable deferred collection through filters
//
- #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
- #define LL_PROFILE_ZONE_SCOPED ZoneScoped
#define LL_PROFILE_ZONE_NUM( val ) ZoneValue( val )
#define LL_PROFILE_ZONE_TEXT( text, size ) ZoneText( text, size )
@@ -127,7 +144,7 @@
#define LL_PROFILE_ZONE_INFO(name) LL_PROFILE_ZONE_NAMED_COLOR( name, 0X00FFFF ) // RGB cyan
#define LL_PROFILE_ZONE_WARN(name) LL_PROFILE_ZONE_NAMED_COLOR( name, 0x0FFFF00 ) // RGB red
// Additional FS Tracy macros
- #define LL_PROFILE_ZONE_COLOR(color) ZoneNamedC( ___tracy_scoped_zone, color, true )
+ #define LL_PROFILE_ZONE_COLOR(color) ZoneNamedC( ___tracy_scoped_zone, color, LLProfiler::active )
#define LL_PROFILE_PLOT( name, value ) TracyPlot( name, value)
#define LL_PROFILE_PLOT_SQ( name, prev, value ) TracyPlot( name, prev );TracyPlot( name, value )
#define LL_PROFILE_IS_CONNECTED TracyIsConnected
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index dfcfa349d8..c03f4e526f 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -24657,10 +24657,10 @@ Change of this parameter will affect the layout of buttons in notification toast
Value
0
- FSTelemetryEnableWhenConnected
+ DeferProfilingUntilConnected
- FSTelemetryActive
+ ProfilingActive