TrackAsyncLoadRequests.StackIgnore
TrackAsyncLoadRequests.StackIgnore
#Overview
name: TrackAsyncLoadRequests.StackIgnore
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Number of items to discard from the top of a stack frame.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of TrackAsyncLoadRequests.StackIgnore is to control the number of items to discard from the top of a stack frame when tracking asynchronous load requests in Unreal Engine 5. This setting is primarily used for debugging and profiling purposes within the asset loading system.
This setting variable is primarily used in the CoreUObject module, specifically in the asynchronous package loading subsystem. It is referenced in the AsyncPackageLoader.cpp file, which is part of the serialization system for loading game assets asynchronously.
The value of this variable is set using a TAutoConsoleVariable, which means it can be adjusted at runtime through console commands. The default value is set to 5, but developers can change this value as needed.
This variable interacts closely with two other variables:
- CVarTrackAsyncLoadRequests_StackLen: Controls the total length of the stack trace to capture.
- CVarTrackAsyncLoadRequests_Dedupe: Determines whether to deduplicate stack traces.
Developers should be aware that this variable affects the level of detail in stack traces when debugging asynchronous load requests. A higher value will ignore more items from the top of the stack, potentially hiding relevant information, while a lower value might include too much noise from common function calls.
Best practices when using this variable include:
- Adjust the value based on the specific debugging needs of your project.
- Use in conjunction with CVarTrackAsyncLoadRequests_StackLen to get the right balance of information.
- Be cautious when setting it to 0, as it might include too much irrelevant information in the stack trace.
- Consider the performance impact of tracking requests, especially in production builds.
Regarding the associated variable CVarTrackAsyncLoadRequests_StackIgnore:
The purpose of CVarTrackAsyncLoadRequests_StackIgnore is the same as TrackAsyncLoadRequests.StackIgnore. It’s the C++ variable that directly controls the behavior described above.
This variable is used in the same CoreUObject module and AsyncPackageLoader.cpp file. Its value is set when the TAutoConsoleVariable is initialized and can be accessed using the GetInt() method.
CVarTrackAsyncLoadRequests_StackIgnore interacts directly with the StackTracker object in the TrackRequest function, where it’s used to determine how many items to ignore when capturing the stack trace.
Developers should be aware that changes to this variable will take effect immediately, potentially affecting ongoing debugging sessions.
Best practices for using CVarTrackAsyncLoadRequests_StackIgnore include:
- Use the console variable interface to adjust the value during runtime for immediate debugging needs.
- Consider exposing this setting in your project’s debugging UI for easier manipulation during development.
- Document any non-default values used in your project to ensure consistency across the development team.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/CoreUObject/Private/Serialization/AsyncPackageLoader.cpp:370
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarTrackAsyncLoadRequests_StackIgnore(
TEXT("TrackAsyncLoadRequests.StackIgnore"),
5,
TEXT("Number of items to discard from the top of a stack frame."));
static TAutoConsoleVariable<int32> CVarTrackAsyncLoadRequests_StackLen(
TEXT("TrackAsyncLoadRequests.StackLen"),
12,
#Associated Variable and Callsites
This variable is associated with another variable named CVarTrackAsyncLoadRequests_StackIgnore
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/CoreUObject/Private/Serialization/AsyncPackageLoader.cpp:369
Scope: file
Source code excerpt:
);
static TAutoConsoleVariable<int32> CVarTrackAsyncLoadRequests_StackIgnore(
TEXT("TrackAsyncLoadRequests.StackIgnore"),
5,
TEXT("Number of items to discard from the top of a stack frame."));
static TAutoConsoleVariable<int32> CVarTrackAsyncLoadRequests_StackLen(
TEXT("TrackAsyncLoadRequests.StackLen"),
#Loc: <Workspace>/Engine/Source/Runtime/CoreUObject/Private/Serialization/AsyncPackageLoader.cpp:483
Scope (from outer to inner):
file
function void TrackRequest
Source code excerpt:
FScopeLock Lock(&CritSec);
StackTracker.CaptureStackTrace(CVarTrackAsyncLoadRequests_StackIgnore->GetInt(), (void*)UserData, CVarTrackAsyncLoadRequests_StackLen->GetInt(), CVarTrackAsyncLoadRequests_Dedupe->GetBool());
}
void Reset()
{
FScopeLock Lock(&CritSec);
StackTracker.ResetTracking();