From f9031ee02d19afe01023936eacc867dcdef01861 Mon Sep 17 00:00:00 2001 From: Ptolemy Date: Thu, 13 Jan 2022 11:22:56 -0800 Subject: SL-16606: Include profiler categories automatically --- indra/llcommon/llprofiler.h | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'indra') 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 -- cgit v1.2.3