VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Classes | Namespaces | Macros | Functions
profiler.h File Reference

Go to the source code of this file.

Classes

class  makVrf::DtProfiler
 

Namespaces

 makVrf
 

Macros

#define TRACY_ENABLE
 
#define DtPROFILEzone   ZoneNamedS(___tracy_scoped_zone, makVrf::DtProfiler::tracyCallstackDepth(), makVrf::DtProfiler::collectTracyStats());
 
#define DtPROFILE(name)
 
#define DtPROFILEC(name, color)
 
#define DtPROFILELEVEL(name, moduleName, level)
 
#define DtPROFILELEVELC(name, color, moduleName, level)
 
#define DtPROFILE_SECTION(name)
 
#define DtPROFILE_ZONE_TEXT(text)   DtZoneSetText(___tracy_scoped_zone, text)
 
#define DtPROFILE_SECTION_END   }
 
#define DtVRF_PROFILE(name)   DtPROFILE(name)
 
#define DtVRF_PROFILE_FILE(name)   DtPROFILE(name)
 
#define DtProfilerFrameMark
 
#define DtProfilerPlot(x, y)   TracyPlot(x, y)
 
#define DtProfilerThreadName(name)   tracy::SetThreadName(name);
 
#define DtProfilerMessage(str, stringLen)   TracyMessage(str, stringLen)
 

Functions

void DtZoneSetText (tracy::ScopedZone &zone, const char *text)
 
void DtZoneSetText (tracy::ScopedZone &zone, const std::string &text)
 

Macro Definition Documentation

#define TRACY_ENABLE

namespace makVrf

Compile-time switch that enables the Tracy profiler integration.

Defaulted to on so that the profiling marker macros below expand to real Tracy calls. VR-Forces has a library-by-library setting, but if a library forgot to include this macro the profiling commands would simply be preprocessed away, which is confusing. With this defined you instead get a linker error, making it obvious that the Tracy libraries must be linked in.

#define DtPROFILEzone   ZoneNamedS(___tracy_scoped_zone, makVrf::DtProfiler::tracyCallstackDepth(), makVrf::DtProfiler::collectTracyStats());

win32 creates macros that work with our stats and tracy

Profiles the enclosing scope, naming the zone after the current function.

Place at the top of a function or block to record a Tracy zone for it. The zone is captured only while DtProfiler::collectTracyStats() is true, using DtProfiler::tracyCallstackDepth() stack frames.

#define DtPROFILE (   name)
Value:
ZoneNamedNS( \
static unsigned int tracyCallstackDepth()
Returns the callstack capture depth applied when recording zones.
static bool collectTracyStats()
Indicates whether Tracy statistics collection is currently active.

Profiles the enclosing scope under an explicit zone name.

Parameters
nameZone name. Pass a string literal / const char* (its pointer is used directly); do not pass a std::string (see the note at the top of this file).
#define DtPROFILEC (   name,
  color 
)
Value:
ZoneNamedNCS(___tracy_scoped_zone, name, color, makVrf::DtProfiler::tracyCallstackDepth(), \
static unsigned int tracyCallstackDepth()
Returns the callstack capture depth applied when recording zones.
static bool collectTracyStats()
Indicates whether Tracy statistics collection is currently active.

Profiles the enclosing scope under an explicit name and display color.

Parameters
nameZone name (pass a const char* literal).
colorZone color shown in the Tracy UI, as a 0xRRGGBB value.

Referenced by DtTracyScopedLock< T_Mutex, T_LockName >::acquire(), DtTracyScopedRwLock< T_Mutex, T_LockName >::acquire(), and DtTracyScopedRwLock< T_Mutex, T_LockName >::upgrade_to_writer().

#define DtPROFILELEVEL (   name,
  moduleName,
  level 
)
Value:
ZoneNamedNS(___tracy_scoped_zone, name, makVrf::DtProfiler::tracyCallstackDepth(), \
DT_DLL_VRVCORE DtTaitBryan level(const DtCoordinateSystem &cs, const DtVector &localOrigin, double topoHeading)
Returns a level orientation with the topographic heading.
static int tracyModuleLevel(size_t moduleNameHash)
Returns the user-configured trace level for a module.
static unsigned int tracyCallstackDepth()
Returns the callstack capture depth applied when recording zones.
static bool collectTracyStats()
Indicates whether Tracy statistics collection is currently active.

Profiles the enclosing scope only when a module's trace level is high enough.

The zone is recorded only while stats are being collected and the level configured for the module (via the "tracy" console command) is at least level. This keeps fine-grained instrumentation off unless explicitly requested for that module.

Parameters
nameZone name (pass a const char* literal).
moduleNameHash key of the module (e.g. DtProfiler::theTerrainModuleName or a value returned by DtProfiler::addExternalModule()).
levelRequired trace level, from 0 to 9.
#define DtPROFILELEVELC (   name,
  color,
  moduleName,
  level 
)
Value:
ZoneNamedNCS(___tracy_scoped_zone, name, color, makVrf::DtProfiler::tracyCallstackDepth(), \
DT_DLL_VRVCORE DtTaitBryan level(const DtCoordinateSystem &cs, const DtVector &localOrigin, double topoHeading)
Returns a level orientation with the topographic heading.
static int tracyModuleLevel(size_t moduleNameHash)
Returns the user-configured trace level for a module.
static unsigned int tracyCallstackDepth()
Returns the callstack capture depth applied when recording zones.
static bool collectTracyStats()
Indicates whether Tracy statistics collection is currently active.

Colored variant of DtPROFILELEVEL.

Parameters
nameZone name (pass a const char* literal).
colorZone color shown in the Tracy UI, as a 0xRRGGBB value.
moduleNameHash key of the module to gate on.
levelRequired trace level, from 0 to 9.
#define DtPROFILE_SECTION (   name)
Value:
{ \
ZoneNamedNS(___tracy_scoped_zone, name, makVrf::DtProfiler::tracyCallstackDepth(), \
static unsigned int tracyCallstackDepth()
Returns the callstack capture depth applied when recording zones.
static bool collectTracyStats()
Indicates whether Tracy statistics collection is currently active.

Begins a manually-scoped profiling section.

Opens a new C++ scope and starts a Tracy zone named name within it. Must be paired with DtPROFILE_SECTION_END to close the scope. Use when profiling a region that does not align with an existing block.

Parameters
nameZone name (pass a const char* literal).
#define DtPROFILE_ZONE_TEXT (   text)    DtZoneSetText(___tracy_scoped_zone, text)

Attaches free-form text to the most recently opened profiling zone.

Parameters
textText to record on the current zone (const char* or std::string).
#define DtPROFILE_SECTION_END   }

Closes a profiling section previously opened with DtPROFILE_SECTION.

#define DtVRF_PROFILE (   name)    DtPROFILE(name)

Backwards-compatible alias for DtPROFILE(name).

#define DtVRF_PROFILE_FILE (   name)    DtPROFILE(name)

Backwards-compatible alias for DtPROFILE(name).

#define DtProfilerFrameMark
Value:
{ \
FrameMark; \
}
static bool collectTracyStats()
Indicates whether Tracy statistics collection is currently active.

Marks the end of a frame on the Tracy timeline.

Call once per frame (e.g. in the main loop). Emits a Tracy frame marker only while DtProfiler::collectTracyStats() is true.

#define DtProfilerPlot (   x,
  y 
)    TracyPlot(x, y)

Plots a named numeric value on the Tracy timeline.

Parameters
xPlot name (const char* literal).
yNumeric value to record for this sample.
#define DtProfilerThreadName (   name)    tracy::SetThreadName(name);

Assigns a human-readable name to the current thread in Tracy.

Parameters
nameThread name to display (const char* literal).
#define DtProfilerMessage (   str,
  stringLen 
)    TracyMessage(str, stringLen)

Logs a message to the Tracy timeline.

Parameters
strPointer to the message characters.
stringLenNumber of characters in str.

Function Documentation

void DtZoneSetText ( tracy::ScopedZone &  zone,
const char *  text 
)
inline

tracy

void DtZoneSetText ( tracy::ScopedZone &  zone,
const std::string &  text 
)
inline

Document ID: Generated on Thu Oct 15 21:27:02 EDT 2026 from SVN revision 296421
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)