summaryrefslogtreecommitdiff
path: root/indra/llcommon
diff options
context:
space:
mode:
authorPtolemy <ptolemy@lindenlab.com>2022-01-13 11:22:56 -0800
committerPtolemy <ptolemy@lindenlab.com>2022-01-14 11:50:18 -0800
commitf9031ee02d19afe01023936eacc867dcdef01861 (patch)
tree500ea960b2e81857c7f2bd981410752c68b67a5d /indra/llcommon
parentc37c727a9b196d6c4053cadcd4c27684a4d93b8e (diff)
SL-16606: Include profiler categories automatically
Diffstat (limited to 'indra/llcommon')
-rw-r--r--indra/llcommon/llprofiler.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/indra/llcommon/llprofiler.h b/indra/llcommon/llprofiler.h
index ca60d23248..f9d7ae7ce4 100644
--- a/indra/llcommon/llprofiler.h
+++ b/indra/llcommon/llprofiler.h
@@ -27,6 +27,44 @@
#ifndef LL_PROFILER_H
#define LL_PROFILER_H
+// If you use the default macros LL_PROFILE_ZONE_SCOPED and LL_PROFILE_ZONE_NAMED to profile code ...
+//
+// void foo()
+// {
+// LL_PROFILE_ZONE_SCOPED;
+// :
+//
+// {
+// LL_PROFILE_ZONE_NAMED("widget bar");
+// :
+// }
+// {
+// LL_PROFILE_ZONE_NAMED("widget qux");
+// :
+// }
+// }
+//
+// ... please be aware that ALL these will show up in a Tracy capture which can quickly exhaust memory.
+// Instead, use LL_PROFILE_ZONE_SCOPED_CATEGORY_* and LL_PROFILE_ZONE_NAMED_CATEGORY_* to profile code ...
+//
+// void foo()
+// {
+// LL_PROFILE_ZONE_SCOPED_CATEGORY_UI;
+// :
+//
+// {
+// LL_PROFILE_ZONE_NAMED_CATEGORY_UI("widget bar");
+// :
+// }
+// {
+// LL_PROFILE_ZONE_NAMED_CATEGORY_UI("widget qux");
+// :
+// }
+// }
+//
+// ... as these can be selectively turned on/off. This will minimize memory usage and visual clutter in a Tracy capture.
+// See llprofiler_categories.h for more details on profiling categories.
+
#define LL_PROFILER_CONFIG_NONE 0 // No profiling
#define LL_PROFILER_CONFIG_FAST_TIMER 1 // Profiling on: Only Fast Timers
#define LL_PROFILER_CONFIG_TRACY 2 // Profiling on: Only Tracy
@@ -108,4 +146,6 @@ extern thread_local bool gProfilerEnabled;
#define LL_PROFILER_SET_THREAD_NAME( name ) (void)(name)
#endif // LL_PROFILER
+#include "llprofilercategories.h"
+
#endif // LL_PROFILER_H