Hooking a Windows API works by patching in a "jmp" instruction. The instructions that are overwritten by this patch are moved elsewhere (and appended with another jmp) such that the original function can still be called - I called this a trampoline. Prior to this change, trampolines were written into the null-filled slack space at the end of the code section. This however turned out to be too small as more hooks were added and as Windows' DLLs mutated. This change instead uses a page of address space which it allocates just before the DLL being patched (proximity is important as the jmp instruction used only has 32 bit signed displacement).
#rb im
#rnx
#jira UE-160315
#rb cdp
#preflight 62fc8c3e0f2aefc97a98ba72
[CL 21421841 by Martin Ridgers in ue5-main branch]
The implementation extends the existing FThreadIdleStats to track critical path vs non-critical path waits for a thread.
The cvar r.RenderThreadTimeIncludesDependentWaits forces the main renderthread stat to use the new behavior, but this is disabled by default for historical tracking reasons.
#rb Nuno Leiria
#ROBOMERGE-AUTHOR: ben.woodhouse
#ROBOMERGE-SOURCE: CL 21386702 via CL 21387159 via CL 21387356 via CL 21391039 via CL 21391830
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v975-21357124)
[CL 21394348 by ben woodhouse in ue5-main branch]
#rb serge.bernier
#ROBOMERGE-AUTHOR: ben.woodhouse
#ROBOMERGE-SOURCE: CL 21355012 via CL 21355934 via CL 21355993 via CL 21356002
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v972-20964824)
[CL 21358177 by ben woodhouse in ue5-main branch]
- Fixed Trace.SnapshotFile not working when trace is already connected.
- Fixed Trace.SnapshotFile to also issue on connection callback. This allows writing events that are not cached but important for the cache (like FName deduplication events).
- Fixed Trace.SnapshotFile to emit sync events at the end of trace in order for analyzer to properly process all traced events.
- TraceLog: Fixed CallbackOnConnect when main thread has multiple local buffers (bug where only partial events were traced).
#jira UE-158136
#fyi Johan.Berg
#fyi Martin.Ridgers
#rb none
#preflight 62d7db1a4b6d775f5f9d4370
#robomerge FNMain
[CL 21178277 by ionut matasaru in ue5-main branch]
Things to note regarding this pass:
* No includes are currently being removed from public headers.
* Any private file that has a #if is currently not being updated.
#preflight 62c703bbd13fac04f11da948
[CL 20985655 by bryan sefcik in ue5-main branch]
Things to note regarding this pass:
* No includes are currently being removed from public headers.
* Any private file that has a #if is currently not being updated.
#rb Devin Doucette and Marc Audy
#preflight 62c62086756222ced497ff95
#preflight 62c626d12f2d04691814d331
#preflight 62c630107e606620fdd64e31
#preflight 62c635c6756222ced49a13cf
[CL 20979027 by bryan sefcik in ue5-main branch]
Add UE_TRACE_AUTOSTART define and set to 0 for FortniteServer
When set to 0 or -traceautostart=0 on command line then GTraceAutoStart is true and tracing isn't started until explicit Trace.Start command.
We disable channels and delay tracing until children are started for forked servers.
Note CL 20881185:
Disable Unreal Insights for servers
Add log when LLM is enabled due to Unreal Insights mem tracking being enabled.
[REVIEW] [at]johan.berg
[REVIEW] [at]johan.berg, [at]Ionut.Matasaru, [at]Ilya.Loshchinin
[FYI] Andrew.Ladenberger
#preflight 62aca6eec0449d3dccb9c4a1
#ROBOMERGE-OWNER: michael.sartain
#ROBOMERGE-AUTHOR: michael.sartain
#ROBOMERGE-SOURCE: CL 20747327 via CL 20926331 via CL 20926342
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v971-20777995)
[CL 20928049 by michael sartain in ue5-main branch]
+ Added a new delegate to the CSV profiler that fires once on frame 0 of the capture so we can send the pause event as soon as valid.
+ The PerformanceTrackingSubsystem now handles sending the pause/resume events as it made more sense.
#rb ben.woodhouse, andrew.ladenberger
#ROBOMERGE-AUTHOR: tyler.staples
#ROBOMERGE-SOURCE: CL 20765956 via CL 20766099 via CL 20766135 via CL 20766258 via CL 20766315
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v970-20704180)
[CL 20767975 by tyler staples in ue5-main branch]
Adds runtime events and analysis for generic meta data scopes. Any scope emitted on the "Metadata" writer will be analyzed and accessible in the metadata provider. Currently one built-in metadata type is provided: "Asset", which mimics LLMs implementation of asset tracking.
#rb ionut.matasaru
#robomerge EngineMerge
#preflight 62b1b35d827ccccb2cd7da0d
[CL 20755918 by Johan Berg in ue5-main branch]
- Argument is a single string which becomes the bookmark name.
#rb ionut.matasaru
#jira UE-89836
#preflight 62ab9e61c6467711b62ff8ba
[CL 20695642 by Jason Nadro in ue5-main branch]
Since there were two different events for declaring strings and FNames, one regular and one no-sync version used in on-connection callback, references would not be correctly resolved. We remove the no sync version and use only one version. In order to solve the synchronizing we defer resolving the strings in analysis.
#preflight 62a9c8932a1103ff5fb784ae
#robomerge EngineMerge
[CL 20668219 by Johan Berg in ue5-main branch]
Adds a tracing subsystem to trace deduplicated strings and FNames.
#rb ionut.matasaru, johan.torp
#preflight 62a2f06b54169bd8aa25a97b
[CL 20591319 by Johan Berg in ue5-main branch]
The cause of the bug is the fact that few allocations are made before loaded modules are registered. For those initial allocs, the stack cannot be properly backtraced and the code caches that info for its function on top of the stack (which is "MemoryTrace_Alloc" in debug config and "CallstackTrace_InitializeInternal" for development config). Further callstacks that encounters those functions stops backtracing, so the result is a "one frame callstack". Debug build is seriously affected by this bug because "MemoryTrace_Alloc" is present in the callstack of majority of allocations (so all of them will be reduced to one frame).
#jira UE-155667
#rb Johan.Berg
#preflight 629ea3ad732d8e28403311d3
[CL 20535244 by ionut matasaru in ue5-main branch]
Adds a callback which is issued from Trace whenever a new connection is established. Any event emitted inside the callback are collected separately and written to the trace stream after important events, but before events collected in the tail buffer. In the engine layer the callback is exposed as static delegate on TraceAuxiliary.
#rb martin.ridgers, ionut.matasaru
#preflight 6298bbad63529f84faeab10b
[CL 20468957 by Johan Berg in ue5-main branch]