Commit Graph

435 Commits

Author SHA1 Message Date
martin ridgers
43da9136b4 Fixed TraceAuxilary starting Trace's thread too early.
Trace's thread can't be started before Trace has been initialised as some internals are not ready prior to that (i.e. the cache and the tail). TraceAux attempts to control the worker thread and indirectly started it too early when processing command line arguments. This would cause data races between the worker thread and initialisation.

#rb im
#rnx
#jira none
#preflight 63296dab0a4ad044de754095

[CL 22090244 by martin ridgers in ue5-main branch]
2022-09-20 05:53:18 -04:00
marc audy
edd83dc1fb Trace:
* Replaced OnTraceFileStarted delegate with OnTraceStarted
* Added OnTraceStopped delegate
* Both events pass if the recording was for a network or file type.

#rb Brian.Bekich, Martin.Ridgers
#preflight

[CL 22088546 by marc audy in ue5-main branch]
2022-09-20 00:42:05 -04:00
louisphilippe seguin
e738e717e3 Trace
* Added trace file created callback:  Useful to gather all trace files created during execution
* Added config option to disable or resize tail buffers via [Trace.Config]:TailSizeBytes
* Added config option for worker thread sleep time via [Trace.Config]:SleepTimeInMS
* Fixed init code so it never creates a workerthread in builds that don't support multithreading

#rb Martin.Ridgets, Ionut.Matasaru

[CL 22013173 by louisphilippe seguin in ue5-main branch]
2022-09-14 15:04:08 -04:00
Martin Ridgers
378f8d57da Added F prefix to Options struct name
#rnx
#rb im
#preflight 632187ee9677b738f4d49188

[CL 22003200 by Martin Ridgers in ue5-main branch]
2022-09-14 04:06:08 -04:00
jordan cristiano
a6428c421c Reenable trace worker thread to fix hitching on the GT.
#rb ionut.matasaru

[CL 21998991 by jordan cristiano in ue5-main branch]
2022-09-13 23:04:20 -04:00
ionut matasaru
33b16eec81 [Insights] Improved performance of OutputBeginDynamicEvent by using a better hash function for the (dynamic scope name) hash maps.
Benchmarks/tests:
Using scope names from a large project (~220K string names), the average cost of adding an entry to TMap improved 2.4x (from 1.2us to 0.5us) and worst case improved 3.8x (from 80ms to 21ms).
Using Lyra (up to 5000 strings per TMap) the worst case improved 3.6x (from 11ms to 3ms).

#jira UE-147219
#rb Catalin.Dragoiu
#preflight 6315e02b7562a90dfa9fa055

[CL 21790925 by ionut matasaru in ue5-main branch]
2022-09-05 07:53:27 -04:00
brian bekich
ed05542a71 CreateProfileFilename will now prefix the current process id to the filename when WITH_SERVER_CODE
#rb louisphilippe.seguin

[CL 21750742 by brian bekich in ue5-main branch]
2022-09-01 19:39:18 -04:00
bryan sefcik
568e06424c Removed including CoreSharedPCH.h.
#jira
#preflight 630770b8516bef57ff245c35

[CL 21572149 by bryan sefcik in ue5-main branch]
2022-08-25 16:49:11 -04:00
ionut matasaru
349bc7d853 [Insights] Removed log when trace is not enabled.
#rb none
#preflight skip

[CL 21540764 by ionut matasaru in ue5-main branch]
2022-08-24 10:53:52 -04:00
mickael gilabert
92a9ae1291 Added ASan CSV Metadata
[REVIEW] [at]ben.woodhouse
#rnx

[CL 21499886 by mickael gilabert in ue5-main branch]
2022-08-22 21:20:14 -04:00
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