Commit Graph

425 Commits

Author SHA1 Message Date
ionut matasaru
49a12e2ef4 [Insights] Added few log messages re trace system initialization.
#rb Catalin.Dragoiu
#preflight 62ff9ccb200ff87e07f78042

[CL 21457305 by ionut matasaru in ue5-main branch]
2022-08-19 10:40:27 -04:00
Catalin Dragoiu
5a319f7b2c Fix inconsistency in Trace.File and Trace.Send functionality when -traceautostart is false.
#jira UE-160824
#rb Ionut.Matasaru
#preflight 62fcfa83542a7a8d75b8c48c

[CL 21425823 by Catalin Dragoiu in ue5-main branch]
2022-08-17 11:29:29 -04:00
Martin Ridgers
d0c3a269df Explicitly allocate pages for hook trampolines.
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]
2022-08-17 02:40:59 -04:00
ben woodhouse
f01fc33a83 Make a new RenderthreadCriticalPath stat which includes dependent waits. The new stat still excludes GPU occlusion query waits, the present wait and non-critical path waits (waiting for the game thread or RHI thread). Waits for tasks kicked on the GT are included though (unlike the existing stat).
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]
2022-08-15 17:15:00 -04:00
ben woodhouse
7db1565880 If the CSV Profiler is running, output the CSV GT/RT frame in the GT and RT frame named events rather than the engine frame numbers, and prefix with Csv.
#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]
2022-08-12 13:23:10 -04:00
mickael gilabert
b2c395d8b8 Trim Low level allocator memory when OS might go into OOM
[REVIEW] [at]rob.millar
[FYI] dave.barrett
#rnx

#ROBOMERGE-OWNER: mickael.gilabert
#ROBOMERGE-AUTHOR: mickael.gilabert
#ROBOMERGE-SOURCE: CL 21204808 via CL 21205552 via CL 21205565 via CL 21205612
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v972-20964824)

[CL 21209877 by mickael gilabert in ue5-main branch]
2022-07-21 17:08:05 -04:00
ionut matasaru
4e18b38891 [Insights]
- 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]
2022-07-20 09:10:22 -04:00
ionut matasaru
9e32afc552 [Insights] Removed unused StaticStringNoSync and FNamNoSync trace events.
#rb none
#preflight 62d7dd21110da0f94468ff4c
#robomerge FNMain

[CL 21178247 by ionut matasaru in ue5-main branch]
2022-07-20 09:07:56 -04:00
bryan sefcik
9905eb52bb Pass 2 on running IWYU on Core.
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]
2022-07-07 12:30:11 -04:00
bryan sefcik
62489fe2b3 Ran a pass of IWYU on Core.
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]
2022-07-06 21:44:18 -04:00
Matt Peters
c5964ef118 TagTrace: Handle LLM TagNames that implicitly declare their parent with directory separators (ParentA/ParentB/LeafName).
#rb Ionut.Matasaru
#rnx
#preflight 62c4336051714c9ecc780b51

[CL 20940945 by Matt Peters in ue5-main branch]
2022-07-05 09:15:30 -04:00
ben woodhouse
f17e6c6f0d CSV profiler - persistent custom stats. Thread-safe helper classes for custom stats that persist across frames.
#rb simon.orr

#ROBOMERGE-AUTHOR: ben.woodhouse
#ROBOMERGE-SOURCE: CL 20939788 via CL 20939799 via CL 20939801
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v971-20777995)

[CL 20940317 by ben woodhouse in ue5-main branch]
2022-07-05 07:28:30 -04:00
michael sartain
96e1f8a8fd Dedicated Server Trace: Implement post-fork initialization on FortniteGame level
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]
2022-07-02 13:43:53 -04:00
Catalin Dragoiu
2cdae10764 Fix shipping compile error.
#jira UE-158110
#robomerge EngineMerge
#rb none
#rnx
#preflight none

[CL 20896021 by Catalin Dragoiu in ue5-main branch]
2022-06-30 11:17:04 -04:00
Catalin Dragoiu
74aec4d0bf Track asset class for packages in CookProfiler
#rb Matt.Peters Francis.Hurteau
#preflight 62bda231a3568e30663c1507
#robomerge EngineMerge

[CL 20894999 by Catalin Dragoiu in ue5-main branch]
2022-06-30 10:13:15 -04:00
ionut matasaru
e00a64e4f5 [Insights] Fixed initialisation of Platform Events (context switches and sampling profiling) by adding a PostInit call to enable functionality based on enabled channels after the system is initialized.
#jira UE-157258
#rb Johan.Berg
#preflight 62b563831371af05d91e5f84
#robomerge EngineMerge

[CL 20828529 by ionut matasaru in ue5-main branch]
2022-06-27 05:22:40 -04:00
Joe Kirchoff
75b4660aeb Resolve typecast warning in ProfilingDebugging
#rb trivial
#rnx
#preflight 62b644ea466962cd9a3826b0

[CL 20819593 by Joe Kirchoff in ue5-main branch]
2022-06-24 19:37:59 -04:00
tyler staples
cc245a8e46 Fix for csv profiler pause event not firing at start of capture
+ 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]
2022-06-21 19:30:02 -04:00
Johan Berg
ca32e4c627 Metadata scopes
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]
2022-06-21 08:20:57 -04:00
Jason Nadro
42b8adda3a Add trace.bookmark console command which simply emits a TRACE_BOOKMARK.
- 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]
2022-06-16 17:26:57 -04:00
Johan Berg
8a92cd22e4 Fix on-connection strings having different type ids.
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]
2022-06-15 08:03:24 -04:00
Marc Audy
0d230333ce Fix non unity errors and #pragma once in cpp warnings
#jira UE-156342
#rnx
#preflight

[CL 20606904 by Marc Audy in ue5-main branch]
2022-06-11 02:02:22 -04:00
Johan Berg
c8a8270308 String tracing
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]
2022-06-10 03:38:35 -04:00
ionut matasaru
dcef95fb8b Fixed callstack tracing not capturing correct backtrace for majority of allocations in Editor Win64 Debug.
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]
2022-06-07 06:36:43 -04:00
Johan Berg
281488e2aa [TraceLog] Add OnConnection callback
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]
2022-06-02 10:01:45 -04:00