csv.RecordTickCounts

csv.RecordTickCounts

#Overview

name: csv.RecordTickCounts

This variable is created as a Console Variable (cvar).

It is referenced in 3 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of csv.RecordTickCounts is to control the recording of tick counts by context when performing CSV capture in Unreal Engine. This setting variable is primarily used for profiling and performance analysis purposes.

This setting variable is utilized by the Engine module, specifically within the tick system. It is referenced in the LevelTick.cpp file, which is part of the core engine functionality for managing level ticks.

The value of this variable is set through a console variable (CVar) system. It is initialized with a default value of 1, meaning it’s enabled by default. Developers can modify this value at runtime using console commands.

The csv.RecordTickCounts variable interacts closely with another variable called CVarDetailedTickContextForCSV. While csv.RecordTickCounts controls whether tick counts are recorded, CVarDetailedTickContextForCSV determines the level of detail in the recorded tick context.

Developers should be aware that this variable is only active in non-shipping builds with the CSV_PROFILER enabled. It’s important to note that enabling this feature may have a performance impact, as it adds additional profiling overhead.

Best practices when using this variable include:

  1. Only enable it when necessary for performance analysis.
  2. Be mindful of the potential performance impact in non-shipping builds.
  3. Use in conjunction with other profiling tools for a comprehensive performance assessment.

Regarding the associated variable CVarRecordTickCountsToCSV:

The purpose of CVarRecordTickCountsToCSV is to serve as the internal representation of the csv.RecordTickCounts console variable within the engine’s code. It allows for programmatic access to the setting’s value.

This variable is used directly in the Engine module, specifically in the tick system implementation. It’s checked during the world tick process to determine whether tick counts should be recorded.

The value of CVarRecordTickCountsToCSV is set automatically by the engine’s console variable system based on the value of csv.RecordTickCounts. Developers typically don’t need to interact with this variable directly, instead using the console commands to modify csv.RecordTickCounts.

CVarRecordTickCountsToCSV interacts closely with CVarDetailedTickContextForCSV, as they both control aspects of tick count recording for CSV profiling.

Developers should be aware that this variable is an implementation detail of the console variable system and should generally not be modified directly in code. Instead, they should use the console variable system to change the value of csv.RecordTickCounts.

Best practices for CVarRecordTickCountsToCSV include:

  1. Avoid modifying it directly in code; use the console variable system instead.
  2. When reading its value in code, use the GetValueOnGameThread() method to ensure thread-safe access.
  3. Remember that changes to this variable will only take effect in non-shipping builds with the CSV_PROFILER enabled.

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/LevelTick.cpp:1184

Scope: file

Source code excerpt:

#if (CSV_PROFILER && !UE_BUILD_SHIPPING)
static TAutoConsoleVariable<int32> CVarRecordTickCountsToCSV(
	TEXT("csv.RecordTickCounts"),
	1,
	TEXT("Record tick counts by context when performing CSV capture"));

static TAutoConsoleVariable<int32> CVarDetailedTickContextForCSV(
	TEXT("csv.DetailedTickContext"),
	0,

#Associated Variable and Callsites

This variable is associated with another variable named CVarRecordTickCountsToCSV. They share the same value. See the following C++ source code.

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/LevelTick.cpp:1183

Scope: file

Source code excerpt:


#if (CSV_PROFILER && !UE_BUILD_SHIPPING)
static TAutoConsoleVariable<int32> CVarRecordTickCountsToCSV(
	TEXT("csv.RecordTickCounts"),
	1,
	TEXT("Record tick counts by context when performing CSV capture"));

static TAutoConsoleVariable<int32> CVarDetailedTickContextForCSV(
	TEXT("csv.DetailedTickContext"),

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/LevelTick.cpp:1211

Scope (from outer to inner):

file
function     static void RecordWorldCountsToCSV

Source code excerpt:

	if(FCsvProfiler::Get()->IsCapturing())
	{
		if (bDoingActorTicks && CVarRecordTickCountsToCSV.GetValueOnGameThread())
		{
			QUICK_SCOPE_CYCLE_COUNTER(STAT_RecordTickCountsToCSV);
			CSV_SCOPED_TIMING_STAT_EXCLUSIVE(RecordTickCountsToCSV);

			bool bDetailed = (CVarDetailedTickContextForCSV.GetValueOnGameThread() != 0);