csv.DetailedTickContext

csv.DetailedTickContext

#Overview

name: csv.DetailedTickContext

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.DetailedTickContext is to control the level of detail provided for tick counts in CSV (Comma-Separated Values) output. This setting variable is primarily used for performance profiling and debugging purposes within Unreal Engine’s tick system.

The Unreal Engine subsystem that relies on this setting variable is the tick system, which is a core part of the engine’s update loop. It’s specifically used in the LevelTick module, as evidenced by its presence in the LevelTick.cpp file.

The value of this variable is set through a console variable (CVar) system. It’s initialized with a default value of 0, which means detailed tick context information is not enabled by default.

This variable interacts with the associated variable CVarDetailedTickContextForCSV. They share the same value and purpose, with CVarDetailedTickContextForCSV being the actual console variable that controls the behavior.

Developers must be aware that enabling this variable (setting it to a non-zero value) will increase the amount of data collected and output to CSV files. This can be useful for detailed profiling but may also impact performance due to the additional overhead of collecting and writing this data.

Best practices when using this variable include:

  1. Only enable it when detailed tick profiling is necessary, as it may impact performance.
  2. Use it in conjunction with other profiling tools to get a comprehensive view of engine performance.
  3. Be prepared to handle and analyze larger CSV files when this option is enabled.

Regarding the associated variable CVarDetailedTickContextForCSV:

The purpose of CVarDetailedTickContextForCSV is identical to csv.DetailedTickContext. It’s the actual console variable that controls whether detailed tick context information is recorded in CSV output.

This variable is used in the LevelTick module of Unreal Engine, specifically in the RecordWorldCountsToCSV function.

The value of this variable is queried using the GetValueOnGameThread() method, indicating that it’s designed to be accessed from the game thread.

When this variable is set to a non-zero value, it enables more detailed tick context information to be collected and recorded in CSV files.

Developers should be aware that enabling this variable will increase the granularity of tick count data, which can be useful for identifying performance bottlenecks but may also increase the overhead of data collection.

Best practices for using CVarDetailedTickContextForCSV include:

  1. Use it in development and debugging scenarios, not in production builds.
  2. Combine it with other profiling techniques to get a comprehensive view of engine performance.
  3. Be prepared to analyze more detailed CSV output when this option is 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:1189

Scope: file

Source code excerpt:


static TAutoConsoleVariable<int32> CVarDetailedTickContextForCSV(
	TEXT("csv.DetailedTickContext"),
	0,
	TEXT("Gives more detailed info for Tick counts in CSV"));

static TAutoConsoleVariable<int32> CVarRecordActorCountsToCSV(
	TEXT("csv.RecordActorCounts"),
	1,

#Associated Variable and Callsites

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

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

Scope: file

Source code excerpt:

	TEXT("Record tick counts by context when performing CSV capture"));

static TAutoConsoleVariable<int32> CVarDetailedTickContextForCSV(
	TEXT("csv.DetailedTickContext"),
	0,
	TEXT("Gives more detailed info for Tick counts in CSV"));

static TAutoConsoleVariable<int32> CVarRecordActorCountsToCSV(
	TEXT("csv.RecordActorCounts"),

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

Scope (from outer to inner):

file
function     static void RecordWorldCountsToCSV

Source code excerpt:

			CSV_SCOPED_TIMING_STAT_EXCLUSIVE(RecordTickCountsToCSV);

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

			TSortedMap<FName, int32, FDefaultAllocator, FNameFastLess> TickContextToCountMap;
			int32 EnabledCount;
			FTickTaskManagerInterface::Get().GetEnabledTickFunctionCounts(World, TickContextToCountMap, EnabledCount, bDetailed, true);

			for (auto It = TickContextToCountMap.CreateConstIterator(); It; ++It)