Commit Graph

390 Commits

Author SHA1 Message Date
geoff evans
0988a55b0a Trace Snapshot to File
### Features
We can now write tailing memory to a utrace file. Snapshotting while tracing to a file or socket is supported.
This change introduces a new console command: Trace.SnapshotFile. It writes the profiling data from memory into an optionally specified a utrace file.

### Testing
Run Editor with -tracefile
Run Editor with -trace, connect live with insights
Run Editor without -trace (this does generate a very small utrace since there is memory and data in the tail even though default channels are not enabled)

#rb johan.berg
#jira UE-150302,UE-150292
#preflight 6272a3213e1f2a9d3a88ee3d

#ROBOMERGE-OWNER: geoff.evans
#ROBOMERGE-AUTHOR: geoff.evans
#ROBOMERGE-SOURCE: CL 20124258 via CL 20125717 via CL 20126082
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v943-19904690)

[CL 20129506 by geoff evans in ue5-main branch]
2022-05-10 17:03:04 -04:00
michael sartain
56a899a84d Move FCsvProfiler BeginFrame / EndFrame to single location in UEngine::TickPerformanceMonitoring() function
This should fix the case where performance counters are set but none of them do Begin / End CSV calls or potentially do multiple calls.

Also add logging to FCsvProfiler::EndFrame() so we can tell when ECsvCommandType::Stop is processed.

#rnx
#rb Ilya.Loshchinin
[FYI] Ben.Woodhouse, Bart.Hawthorne, Andrew.Ladenberger
#preflight 626eb998c731e279c32db6ba

#ROBOMERGE-AUTHOR: michael.sartain
#ROBOMERGE-SOURCE: CL 20041664 via CL 20042062 via CL 20042078 via CL 20042092 via CL 20042112
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v943-19904690)

[CL 20043206 by michael sartain in ue5-main branch]
2022-05-04 12:17:27 -04:00
geoff evans
1981b2f5f3 StallDetector support for Linux
### Features

This change enables the StallDetector watchdog in Editor to submit reports to crashreporter about threads violating instrumented deadlines in the source code. This feature was available prior on Windows, and this change adds Linux support.

### Notes

New APIs:
ReportStall()
CaptureThreadPortableCallStack()

Many APIs are updated from purely "Ensure" naming to more general naming. Stalls are more like Ensures than crashes, and so the appropriate renames to make the code readable and clear have been made. In some places Ensure is replaced with the clearer: Continuable Event nomenclature.

### Testing

I synthesized an ensure on Linux, and did the same for a stall. I then compared crash report XML file to make sure they contain accurate data in the callstack, portable callstack, and other fields in the report. I also noted that the stall information was showing as expected in the crash reporter.

#rb brandon.schaefer, francis.hurteau
#jira UETOOL-3336
#preflight 625e20d2804460ab0fea3277

[CL 19911608 by geoff evans in ue5-main branch]
2022-04-25 19:19:04 -04:00
Johan Berg
1cbc991e0e Fix issue with externally connected trace connections and status message.
#rb none
#jira UE-148943
#preflight 6262b517bc24759dc736f313

[CL 19864696 by Johan Berg in ue5-main branch]
2022-04-22 10:06:31 -04:00
john huelin
7332066e27 Fix 2 Insights callstack tracing crashes when capturing on some platforms.
First one because due to RTC in EOS not having frame pointers causing a crash when walking down the stack. Limiting callstack tracing with a scope.

The second one because of limited stack size (4k) in a Curl Helper thread, causing a crash when walking down the stack because the callstack walker was allocating 4k on the stack. Doing it inplace to allocate only 2k.

[REVIEW] [at]johan.berg
[FYI] pavel.punsky
#rnx

#ROBOMERGE-OWNER: john.huelin
#ROBOMERGE-AUTHOR: john.huelin
#ROBOMERGE-SOURCE: CL 19739450 via CL 19739526 via CL 19739543 via CL 19739742 via CL 19739765
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v938-19570697)

[CL 19741582 by john huelin in ue5-main branch]
2022-04-13 12:50:15 -04:00
Sebastian Thomeczek
53ad72b2e5 FTraceAuxiliary: Added GetTraceDestination, IsConnected and GetActiveChannelsString to public interface.
#rb Johan.Berg
#preflight none

[CL 19667767 by Sebastian Thomeczek in ue5-main branch]
2022-04-07 09:18:58 -04:00
Johan Berg
3962277bdd Add a way to express fallback tag in Memory Trace
Manual memory tracking in LLM has a feature for defining a "fallback tag" for the allocation if no tag is currently set. This change adds a new scope type which allows us to express this behaviour in memory tracing as well.

#jira UE-142692
#rb ionut.matasaru
#preflight 624ed4e9bd5b36eec338a937

[CL 19667413 by Johan Berg in ue5-main branch]
2022-04-07 08:48:22 -04:00
Arne Schober
e2a4b02ddf M - Support for Unreal Insights to allow Suspend/Resume of Scope stacks which is Used by Coroutines.
#preflight 624c70b27d2eea4e18e0ad62

[CL 19639870 by Arne Schober in ue5-main branch]
2022-04-05 22:30:11 -04:00
Andriy Tylychko
3b82927aee removed unused NewTasks from TaskGraph's FGraphEvent::DispatchSubsequents() calls, as a preparation for deprecation
#preflight https://horde.devtools.epicgames.com/job/6244160fdc6183e3f5ef6650
#rb francis.hurteau, danny.couture

[CL 19554617 by Andriy Tylychko in ue5-main branch]
2022-03-30 04:53:52 -04:00
Catalin Dragoiu
e0475b1694 Screenshot tracing initial implementation
#rb Ionut.Matasaru Johan.Berg
#preflight 6239f65abc1cf2803864a90c

[CL 19467957 by Catalin Dragoiu in ue5-main branch]
2022-03-22 12:35:42 -04:00
johan berg
609ae4d475 Added comment about recent code change.
#rb none
#jira UE-145981

#ROBOMERGE-AUTHOR: johan.berg
#ROBOMERGE-SOURCE: CL 19406039 via CL 19409720 via CL 19420090 via CL 19420214
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v930-19419903)

[CL 19421095 by johan berg in ue5-main branch]
2022-03-17 11:16:44 -04:00
robert millar
378003d083 Fix very large hash bucket in backtrace by explicitly storing -1 for functions with complex unwinds rather than truncating.
#rb johan.berg
#jira UE-145980

#ROBOMERGE-AUTHOR: robert.millar
#ROBOMERGE-SOURCE: CL 19387487 via CL 19388738 via CL 19390713 via CL 19398886 via CL 19399041
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v926-19321884)

[CL 19403777 by robert millar in ue5-main branch]
2022-03-16 03:47:50 -04:00
jian ru
da3568ff5c PS4 2 MB GPU page tunings:
- Added a range allocator for allocating small blocks. It is enabled if 2 MB GPU page is used to reduce memory overhead. Perf is on par with FGPUMemoryPage.
- 20-run ReplayRun test data with 2 MB page and the new allocator: -0.12 ms FrameTime Avg, -0.17 ms GameThreadTime Avg, -0.43 ms RenderThreadTime Avg, -0.12 ms RHIThreadTime Avg, +0.6 DynRes % Avg, and +18 MemFreeMB Min.
- Added support for recording and replaying FMemBlock allocations. Courtesy to Ben for providing most of the code.
- Small adjustment to how MemBlockStat_Wasted is calculated. It now takes unused page space into account in addition to alignment paddings.
- 2 MB GPU page is enabled by default but can be disabled through a project define.

#rb luke.thatcher, ben.woodhouse

#ROBOMERGE-AUTHOR: jian.ru
#ROBOMERGE-SOURCE: CL 19065260 via CL 19065261 via CL 19065262 via CL 19083385 via CL 19084250 via CL 19086050
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v921-19075845)

[CL 19124776 by jian ru in ue5-main branch]
2022-02-24 15:53:12 -05:00
robert millar
5811293e2a Add TargetRules.bFNameOutlineNumber as an option to reduce the size of FName by 4 bytes by storing the number in the name table.
Adds a define UE_FNAME_OUTLINE_NUMBER.
Removes of FName, FMinimalName from memory image support. Adds of FMemoryImageName.
Removal of FMinimalName operator<<, all fields made private, size made variable.
All fields of FScriptName made private.
Added console commands for dumping numbered/unnumbered names and stats.

#rb johan.torp

#ROBOMERGE-OWNER: robert.millar
#ROBOMERGE-AUTHOR: robert.millar
#ROBOMERGE-SOURCE: CL 19058026 via CL 19058611 via CL 19058656 via CL 19061727 via CL 19061740 via CL 19064047
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v918-19018356)

[CL 19066701 by robert millar in ue5-main branch]
2022-02-21 02:35:48 -05:00
robert millar
b4bfddef0a MallocBinned2 fork support.
Clear caches and update a canary value across the fork boundary to avoid touching pages that were allocated pre-fork to minimize unnecessary duplication of shared pages.
Savings depend on pre-fork fragmentation/slack and number of concurrent child processes.

#rb louisphilippe.seguin, johan.torp, arciel.rekman

#ROBOMERGE-OWNER: robert.millar
#ROBOMERGE-AUTHOR: robert.millar
#ROBOMERGE-SOURCE: CL 19057122 via CL 19057644 via CL 19057693 via CL 19057718 via CL 19057737 via CL 19059617
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v918-19018356)

[CL 19066314 by robert millar in ue5-main branch]
2022-02-21 02:04:42 -05:00
ilya loshchinin
7bfdf97694 Fixed CSV profiler thread allocating temporary memory and potentially blocking the memory allocator.
#rb louisphilippe.seguin
#preflight 620e66a5ce15efbba68afae0

#ROBOMERGE-AUTHOR: ilya.loshchinin
#ROBOMERGE-SOURCE: CL 19036025 via CL 19036072 via CL 19036095 via CL 19036473
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v918-19018356)

[CL 19036564 by ilya loshchinin in ue5-main branch]
2022-02-17 12:21:25 -05:00
ionut matasaru
06d9ea5567 [Insights] Added hooks for VirtualAlloc2 API for memory tracing.
#jira UE-131214
#rb Johan.Berg
#preflight 61fd0455b5092d45ad1325a4

[CL 18861473 by ionut matasaru in ue5-main branch]
2022-02-04 06:01:58 -05:00
ben woodhouse
c7c995264b Add named events for EventWait stats instrumented via BeginSetWaitStat/EndSetWaitStat if -csvNamedEvents is enabled.
#ROBOMERGE-AUTHOR: ben.woodhouse
#ROBOMERGE-SOURCE: CL 18847479 via CL 18848589 via CL 18848624 via CL 18854020 via CL 18854481
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v910-18824042)

[CL 18854518 by ben woodhouse in ue5-main branch]
2022-02-03 18:04:27 -05:00
catalin dragoiu
a2133173d2 Fix non unity build error for Unreal Insights
#rb trivial
#preflight 61f9117ac54b18c42dcef6eb

#ROBOMERGE-AUTHOR: catalin.dragoiu
#ROBOMERGE-SOURCE: CL 18806716 in //UE5/Release-5.0/... via CL 18808598 via CL 18822196
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v908-18788545)

[CL 18822500 by catalin dragoiu in ue5-main branch]
2022-02-02 02:46:56 -05:00
ionut matasaru
a0903e7039 [Insights] Fixed memory tracking for "ProgramSize" of loaded modules (dlls), to emit a free event when dll is unloaded.
#jira UE-140358
#rb Johan.Berg
#preflight 61f796986a7c7b134f2f7aec

#ROBOMERGE-AUTHOR: ionut.matasaru
#ROBOMERGE-SOURCE: CL 18787309 in //UE5/Release-5.0/... via CL 18787313 via CL 18787334
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v903-18687472)

[CL 18787335 by ionut matasaru in ue5-main branch]
2022-01-31 03:11:27 -05:00
eric mcdaniel
361f6b69d1 [Backout] - CL18771801
- this change prevents gauntlet from running tasks on Xbox so I am backing it out
  - instance of Horde failure:  https://horde.devtools.epicgames.com/job/61f43b2f74510448a686da51?step=72cc

- the XboxConsoleInputReader thread is created and immediately terminates
  - this change introduced a null out of Runnable in the Xbox version of FRunnableThreadWin::Run()
    - this causes FRunnableThread::SetupCreatedThread() to assert on startup that a valid runnable thread was created but has no Runnable

#rb none
#preflight 61f47fb6801201ab389bb311
[FYI] ionut.matasaru

Original CL Desc
-----------------------------------------------------------------
[Insights]
  - Fixed memory tracking for an FRunnableThread to emit a free event when the thread ends.
  - Fixed memory tracking for "ProgramSize" of loaded modules (dlls), to emit a free event when dll is unloaded.

#jira UE-140358
#rb Johan.Berg
#preflight 61f40923f628752a568b292b

#ROBOMERGE-AUTHOR: eric.mcdaniel
#ROBOMERGE-SOURCE: CL 18781656 in //UE5/Release-5.0/... via CL 18781895 via CL 18781943
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v903-18687472)

[CL 18781953 by eric mcdaniel in ue5-main branch]
2022-01-28 20:10:09 -05:00
ionut matasaru
c56cc42e9f [Insights]
- Fixed parsing of Trace.Start/Trace.File console command params to correctly detect "file path" and "list of channels" parameters.
  - Fixed Trace.Disable to not save anymore the previous enabled channels as "paused" preset.
  - Fixed Trace::Connect (Tarce.Send, Trace.File) to not resume paused channels anymore.

#jira UE-140495
#rb none
#preflight 61f448837a7f0d39ddf2d923

#ROBOMERGE-AUTHOR: ionut.matasaru
#ROBOMERGE-SOURCE: CL 18777275 in //UE5/Release-5.0/... via CL 18778397 via CL 18778925
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v903-18687472)

[CL 18778961 by ionut matasaru in ue5-main branch]
2022-01-28 16:45:39 -05:00
ionut matasaru
2df95139ab [Insights]
- Fixed memory tracking for an FRunnableThread to emit a free event when the thread ends.
  - Fixed memory tracking for "ProgramSize" of loaded modules (dlls), to emit a free event when dll is unloaded.

#jira UE-140358
#rb Johan.Berg
#preflight 61f40923f628752a568b292b

#ROBOMERGE-AUTHOR: ionut.matasaru
#ROBOMERGE-SOURCE: CL 18771801 in //UE5/Release-5.0/... via CL 18771806 via CL 18771881
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v903-18687472)

[CL 18771891 by ionut matasaru in ue5-main branch]
2022-01-28 10:54:49 -05:00
johan berg
38795db092 [Insights] Fixes for mismatching alloc/free events when using MiMalloc
#preflight 61f40bd6241aeec8655410c0

#ROBOMERGE-AUTHOR: johan.berg
#ROBOMERGE-SOURCE: CL 18771777 in //UE5/Release-5.0/... via CL 18771791 via CL 18771877
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v903-18687472)

[CL 18771890 by johan berg in ue5-main branch]
2022-01-28 10:54:42 -05:00
johan berg
9b47e4306b [Insights] Auto connect would always enable default channels.
Using auto connect would always enable default channel, even if started with a specific channel. Also renamed internal type to avoid confusion with TraceLog's FChannel.

#rb ionut.matasaru
#preflight 61f40a3074510448a6818204

#ROBOMERGE-AUTHOR: johan.berg
#ROBOMERGE-SOURCE: CL 18771519 in //UE5/Release-5.0/... via CL 18771526 via CL 18771686
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v903-18687472)

[CL 18771706 by johan berg in ue5-main branch]
2022-01-28 10:35:54 -05:00