![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#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 |
Stack tracker. Used to identify callstacks at any point in the codebase.
Used to delete a provided userdata pointer e.g. call the correct destructor
| typedef void(* FStackTracker::StackTrackerReportFn) (const FCallStack &CallStack, uint64 TotalStackCount, FOutputDevice &Ar) |
Used to optionally report information based on the current stack
| typedef void(* FStackTracker::StackTrackerUpdateFn) (const FCallStack &CallStack, void *UserData) |
Used to optionally update the information currently stored with the callstack
| FStackTracker::FStackTracker | ( | StackTrackerUpdateFn | InUpdateFn = nullptr, |
| StackTrackerReportFn | InReportFn = nullptr, |
||
| StackTrackerDeleteUserDataFn | InDeleteUserDataFn = nullptr, |
||
| bool | bInIsEnabled = false |
||
| ) |
Constructor, initializing all member variables
| 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
| void FStackTracker::DumpStackTraces | ( | int32 | StackThreshold, |
| FOutputDevice & | Ar, | ||
| float | SampleCountCorrectionFactor = 1.0 |
||
| ) |
Dumps capture stack trace summary to the passed in log.
| void FStackTracker::ResetTracking | ( | ) |
Resets stack tracking. Deletes all user pointers passed in via CaptureStackTrace()
| void FStackTracker::ToggleTracking | ( | ) |
Toggles tracking.
Maximum number of backtrace depth.