Commit Graph

204 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
David Harvey
3997a1ff0c fix platform file trace for modular builds.
#jira UE-151231
#rnx
#rb trivial
#preflight 6278febdf34e710b6de75a71

[CL 20101167 by David Harvey in ue5-main branch]
2022-05-09 07:49:16 -04:00
nuno leiria
e285a188a9 Misc changes required to build consoles as modules
#rb trivial
#preflight 626a8f0e631e64c0b9021363

[CL 19960219 by nuno leiria in ue5-main branch]
2022-04-28 09:16:32 -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
john huelin
362d3dc7c8 Fix compilation of nonunity build
#rb mickael.gilabert
#rnx

#ROBOMERGE-OWNER: hilda.cruz
#ROBOMERGE-AUTHOR: john.huelin
#ROBOMERGE-SOURCE: CL 19742953 via CL 19743504 via CL 19744060 via CL 19744380 via CL 19744561
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v939-19570697)

[CL 19801681 by john huelin in ue5-main branch]
2022-04-18 23:22:39 -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
ionut matasaru
47ed4fbd6b Improved struct packing for TCounter (32 --> 20 bytes) and FScopedDetailTickStats (32 --> 24 bytes).
#rb Catalin.Dragoiu
#preflight 624c03dee434babd8a407f74

[CL 19622034 by ionut matasaru in ue5-main branch]
2022-04-05 05:17:08 -04:00
Catalin Dragoiu
642b61b238 Fix compile error in TraceScreenshot.cpp
#rb trivial
#preflight 623a051810251d53d5742e5b

[CL 19469125 by Catalin Dragoiu in ue5-main branch]
2022-03-22 13:55: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
24596d30fd [Insights] Set default parameter value for channels in Start
#rb ionut.matasaru
#preflight 6229f366377a9e55bacbdf94

[CL 19334657 by Johan Berg in ue5-main branch]
2022-03-10 07:52:14 -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
evgenii babinets
56c7c2c121 Fixed compile errors on FN servers where trace events were not enabled. Needed to update the CPUPROFILERTRACE_ENABLED 0 macros as well.
#rb jordan.cristiano

#ROBOMERGE-OWNER: aurel.cordonnier
#ROBOMERGE-AUTHOR: evgenii.babinets
#ROBOMERGE-COMMAND: _robomerge UE5-Main
#ROBOMERGE-SOURCE: CL 19018687 via CL 19018740 via CL 19018773 via CL 19028082
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v917-18934589)

[CL 19028102 by evgenii babinets in ue5-main branch]
2022-02-16 20:15:57 -05:00
evgenii babinets
92b6faea1c Optimize code size and overhead for Insights markers generated for scope cycle counters. Down from 213 bytes per marker to 142 bytes (overall program size down ~600KB).
Details: removes duplicate checks on CpuChannel by resolving SpecIds inside the scope event structure and avoiding passing in CpuChannel as the fine-grained channel when we always check CpuChannel at least.

#rb jordan.cristiano

#ROBOMERGE-AUTHOR: evgenii.babinets
#ROBOMERGE-SOURCE: CL 19003995 via CL 19004354 via CL 19005197 via CL 19008129 via CL 19008734
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v917-18934589)

[CL 19008810 by evgenii babinets in ue5-main branch]
2022-02-15 20:37:22 -05:00
ionut matasaru
a6866d78e1 [Insights]
- Updated help for trace console commands.
  - Fixed comments and code style issues in TraceAuxiliary.

#rb Johan.Berg
#preflight 61ea7ced445cebac10bcd2da

#ROBOMERGE-OWNER: ionut.matasaru
#ROBOMERGE-AUTHOR: ionut.matasaru
#ROBOMERGE-SOURCE: CL 18687495 in //UE5/Release-5.0/... via CL 18687855 via CL 18687859
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v903-18687472)

[CL 18687864 by ionut matasaru in ue5-main branch]
2022-01-21 06:40:36 -05:00
johan berg
a56558e662 [Insights] Fix copy paste and build error
* An extra '&' token was removed on the type alias in the no logging case.
 * In the case where trace is enabled, but logging is disabled, made a identical solution in TraceAuxImpl.

#rb ionut.matasaru
#jira UE-139439, UE-139433, UE-139444
#preflight 61e80742843acf1b2429961b

#ROBOMERGE-AUTHOR: johan.berg
#ROBOMERGE-SOURCE: CL 18657057 in //UE5/Release-5.0/... via CL 18657068 via CL 18657070
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v900-18638592)

[CL 18657072 by johan berg in ue5-main branch]
2022-01-19 07:58:49 -05:00
johan berg
f7c959da10 [Insights] Nonunity build fixes.
#rb none
#preflight 61e69dfd3778a195dea5a670

#ROBOMERGE-AUTHOR: johan.berg
#ROBOMERGE-SOURCE: CL 18638138 in //UE5/Release-5.0/... via CL 18638141 via CL 18638153
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v899-18417669)

[CL 18638169 by johan berg in ue5-main branch]
2022-01-18 06:19:58 -05:00
johan berg
8faf5c82d8 [Insights] Fix for no logging situations
#rb ionut.matasaru
#preflight 61e586b0873f2ea48f2fdd62

#ROBOMERGE-OWNER: johan.berg
#ROBOMERGE-AUTHOR: johan.berg
#ROBOMERGE-SOURCE: CL 18633108 in //UE5/Release-5.0/... via CL 18633166 via CL 18633182
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v899-18417669)

[CL 18637368 by johan berg in ue5-main branch]
2022-01-18 04:30:03 -05:00
johan berg
61dc9c192e [Insights] Allow log output in TraceAux to be routed to arbitrary category.
In order to be able to output detailed error and status messages to both core log or console feedback log depending on situation, add argument to set the target category. Also removed now redundant logs in console commands, since more detailed information is now emitted on the console feedback.
#preflight 61e56f34873f2ea48f23d007

#ROBOMERGE-OWNER: johan.berg
#ROBOMERGE-AUTHOR: johan.berg
#ROBOMERGE-SOURCE: CL 18632544 in //UE5/Release-5.0/... via CL 18633016 via CL 18633031
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v899-18417669)
#ROBOMERGE-CONFLICT from-shelf

[CL 18637343 by johan berg in ue5-main branch]
2022-01-18 04:24:47 -05:00
devin doucette
fd82da3de9 DDC: Factored out common code in AsyncPut and added stats
#rb Zousar.Shaker
#rnx
#preflight 61e0982b797757aace8a7d35

#ROBOMERGE-AUTHOR: devin.doucette
#ROBOMERGE-SOURCE: CL 18605473 in //UE5/Release-5.0/... via CL 18605523 via CL 18605540
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v899-18417669)

[CL 18605575 by devin doucette in ue5-main branch]
2022-01-13 16:44:15 -05:00
johan berg
f26d26c315 [Insights] Move UE_MEMORY_TAGS_TRACE_ENABLED to build file.
We need to set this define in other platform build files, and since some of them are included on windows (editor) builds as well, we can end up with warnings of redefinition of variable.
#preflight 61e025e11e7c2075bb218b0f

#ROBOMERGE-AUTHOR: johan.berg
#ROBOMERGE-SOURCE: CL 18595866 in //UE5/Release-5.0/... via CL 18595880 via CL 18595890
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Test -> Main) (v899-18417669)

[CL 18596773 by johan berg in ue5-main branch]
2022-01-13 10:14:29 -05:00
johan berg
c8d7f56daa [Insights] Clarify HeapId argument for mark as heap command.
#preflight 61e01e2e1e7c2075bb207de7

#ROBOMERGE-AUTHOR: johan.berg
#ROBOMERGE-SOURCE: CL 18595647 in //UE5/Release-5.0/... via CL 18595651 via CL 18595655
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Test -> Main) (v899-18417669)

[CL 18596721 by johan berg in ue5-main branch]
2022-01-13 10:11:12 -05:00
ben woodhouse
4c4e02819c Fix parsing of the -csvmetadata arg, so it doesn't stop on separators
Refactor csvExecCmds to move the initialization logic into the CSV profiler itself. The execution still needs to happen in the engine, but this is now done during normal frame processing.
Fix a bug when processing csv execcmds with colons, e.g file paths

#ROBOMERGE-OWNER: ben.woodhouse
#ROBOMERGE-AUTHOR: ben.woodhouse
#ROBOMERGE-SOURCE: CL 18442929 via CL 18442943 via CL 18442951 via CL 18445402 via CL 18445577 via CL 18445604
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Test -> Main) (v897-18405271)

[CL 18447887 by ben woodhouse in ue5-main branch]
2021-12-13 15:16:06 -05:00