t.FPSChart.DoCsvProfile

t.FPSChart.DoCsvProfile

#Overview

name: t.FPSChart.DoCsvProfile

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

It is referenced in 4 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of t.FPSChart.DoCsvProfile is to control whether a CSV profile should be recorded when capturing FPSChart data in Unreal Engine 5. This setting is primarily used for performance profiling and analysis.

This setting variable is mainly utilized by the Engine module, specifically within the ChartCreation system. It’s also referenced in the ICVFXTesting plugin, which is part of the Virtual Production toolset.

The value of this variable is set through the console or configuration files. It’s defined as a TAutoConsoleVariable, which means it can be changed at runtime through console commands.

The associated variable GFPSChartDoCsvProfile interacts directly with t.FPSChart.DoCsvProfile. They share the same value, with GFPSChartDoCsvProfile being the actual implementation variable that the engine code checks.

Developers should be aware that enabling this setting will impact performance due to the additional overhead of CSV profiling. It should only be used when detailed performance data is required, typically during development or debugging sessions.

Best practices for using this variable include:

  1. Only enable it when necessary for performance analysis.
  2. Ensure it’s disabled in production builds to avoid performance overhead.
  3. Use it in conjunction with other profiling tools for a comprehensive performance overview.

Regarding the associated variable GFPSChartDoCsvProfile:

Its purpose is to serve as the actual implementation variable that the engine code checks to determine if CSV profiling should be enabled during FPSChart data recording.

This variable is used within the Engine module, specifically in the ChartCreation system. It’s checked in the UEngine::StartFPSChart function to determine whether to start CSV profiling.

The value of GFPSChartDoCsvProfile is set automatically based on the t.FPSChart.DoCsvProfile console variable.

It interacts with a boolean variable GFPSChartCSVProfileActive, which is set to true when CSV profiling is initiated.

Developers should be aware that this variable directly controls the CSV profiling behavior and impacts performance when enabled.

Best practices include:

  1. Avoid directly modifying this variable; instead, use the t.FPSChart.DoCsvProfile console command.
  2. When analyzing performance, check both this variable and GFPSChartCSVProfileActive to ensure profiling is active.
  3. Remember to disable profiling after gathering necessary data to restore normal performance.

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/ChartCreation.cpp:55

Scope: file

Source code excerpt:


static TAutoConsoleVariable<int32> GFPSChartDoCsvProfile(
	TEXT("t.FPSChart.DoCsvProfile"),
	0,
	TEXT("Whether to record a CSV profile when recording FPSChart data\n")
	TEXT(" default: 0"));
#endif // FPS_CHART_SUPPORT_CSV_PROFILE

float GMaximumFrameTimeToConsiderForHitchesAndBinning = 10.0f;

#Loc: <Workspace>/Engine/Plugins/VirtualProduction/ICVFXTesting/Source/ICVFXTesting/Public/ICVFXTestControllerBase.h:71

Scope (from outer to inner):

file
class        class UICVFXTestControllerBase : public UGauntletTestController

Source code excerpt:

	/** List of command prefixes used to find and execute commands passed in through commandline or config OnInit. */
	const TArray<FString> CmdsToExecEarly = {
		TEXT("t.FPSChart.DoCsvProfile"),
		TEXT("ICVFXTest"),
		TEXT("r.nanite"),
		TEXT("r.ScreenPercentage"),
		TEXT("r.RayTracing"),
		TEXT("r.DynamicGlobalIlluminationMethod"),
		TEXT("r.ReflectionMethod"),

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/ChartCreation.cpp:54

Scope: file

Source code excerpt:

static bool GFPSChartCSVProfileActive = false;

static TAutoConsoleVariable<int32> GFPSChartDoCsvProfile(
	TEXT("t.FPSChart.DoCsvProfile"),
	0,
	TEXT("Whether to record a CSV profile when recording FPSChart data\n")
	TEXT(" default: 0"));
#endif // FPS_CHART_SUPPORT_CSV_PROFILE

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/ChartCreation.cpp:1501

Scope (from outer to inner):

file
function     void UEngine::StartFPSChart

Source code excerpt:


#if FPS_CHART_SUPPORT_CSV_PROFILE
	if (GFPSChartDoCsvProfile.GetValueOnGameThread())
	{
		if (!FCsvProfiler::Get()->IsCapturing())
		{
			GFPSChartCSVProfileActive = true;
			FString OutputDirectory = FPerformanceTrackingSystem::CreateOutputDirectory(CaptureStartTime);
			const FString PlatformName = FPlatformProperties::PlatformName();