UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FStackTracker Struct Reference

#include <StackTracker.h>

Classes

struct  FCallStack
 

Public Types

typedef void(* StackTrackerUpdateFn) (const FCallStack &CallStack, void *UserData)
 
typedef void(* StackTrackerReportFn) (const FCallStack &CallStack, uint64 TotalStackCount, FOutputDevice &Ar)
 
typedef void(* StackTrackerDeleteUserDataFn) (void *)
 

Public Member Functions

CORE_API FStackTracker (StackTrackerUpdateFn InUpdateFn=nullptr, StackTrackerReportFn InReportFn=nullptr, StackTrackerDeleteUserDataFn InDeleteUserDataFn=nullptr, bool bInIsEnabled=false)
 
CORE_API void CaptureStackTrace (int32 EntriesToIgnore=2, void *UserData=nullptr, int32 StackLen=MAX_int32, bool bLookupStringsForAliasRemoval=false)
 
CORE_API void DumpStackTraces (int32 StackThreshold, FOutputDevice &Ar, float SampleCountCorrectionFactor=1.0)
 
CORE_API void ResetTracking ()
 
CORE_API void ToggleTracking ()
 
CORE_API void ToggleTracking (bool bEnable, bool bSilent)
 

Static Public Member Functions

static void DefaultDeleteUserDataFn (void *UserData)
 

Static Public Attributes

static constexpr int32 MAX_BACKTRACE_DEPTH = 50
 

Detailed Description

Stack tracker. Used to identify callstacks at any point in the codebase.

Member Typedef Documentation

◆ StackTrackerDeleteUserDataFn

typedef void(* FStackTracker::StackTrackerDeleteUserDataFn) (void *)

Used to delete a provided userdata pointer e.g. call the correct destructor

◆ StackTrackerReportFn

typedef void(* FStackTracker::StackTrackerReportFn) (const FCallStack &CallStack, uint64 TotalStackCount, FOutputDevice &Ar)

Used to optionally report information based on the current stack

◆ StackTrackerUpdateFn

typedef void(* FStackTracker::StackTrackerUpdateFn) (const FCallStack &CallStack, void *UserData)

Used to optionally update the information currently stored with the callstack

Constructor & Destructor Documentation

◆ FStackTracker()

FStackTracker::FStackTracker ( StackTrackerUpdateFn  InUpdateFn = nullptr,
StackTrackerReportFn  InReportFn = nullptr,
StackTrackerDeleteUserDataFn  InDeleteUserDataFn = nullptr,
bool  bInIsEnabled = false 
)

Constructor, initializing all member variables

Member Function Documentation

◆ CaptureStackTrace()

void FStackTracker::CaptureStackTrace ( int32  EntriesToIgnore = 2,
void UserData = nullptr,
int32  StackLen = MAX_int32,
bool  bLookupStringsForAliasRemoval = false 
)

Captures the current stack and updates stack tracking information. optionally stores a user data pointer that the tracker will take ownership of and delete upon reset you must allocate the memory with FMemory::Malloc() or provide a custom delete function EntriesToIgnore are removed from the top of then stack, then we keep at most StackLen of the remaining entries.

Captures the current stack and updates stack tracking information. optionally stores a user data pointer that the tracker will take ownership of and delete upon reset you must allocate the memory with FMemory::Malloc() or provide a custom delete function

◆ DefaultDeleteUserDataFn()

void FStackTracker::DefaultDeleteUserDataFn ( void UserData)
static

◆ DumpStackTraces()

void FStackTracker::DumpStackTraces ( int32  StackThreshold,
FOutputDevice Ar,
float  SampleCountCorrectionFactor = 1.0 
)

Dumps capture stack trace summary to the passed in log.

◆ ResetTracking()

void FStackTracker::ResetTracking ( )

Resets stack tracking. Deletes all user pointers passed in via CaptureStackTrace()

◆ ToggleTracking() [1/2]

void FStackTracker::ToggleTracking ( )

Toggles tracking.

◆ ToggleTracking() [2/2]

void FStackTracker::ToggleTracking ( bool  bEnable,
bool  bSilent 
)

Member Data Documentation

◆ MAX_BACKTRACE_DEPTH

constexpr int32 FStackTracker::MAX_BACKTRACE_DEPTH = 50
staticconstexpr

Maximum number of backtrace depth.


The documentation for this struct was generated from the following files: