Commit Graph

217 Commits

Author SHA1 Message Date
geoff evans
211e371099 Move up StallDetector shutdown into PreExit to shutdown before exceptions in OnExit broadcast.
Use SleepNoStats to prevent stat accumulation of sleep time
Remove CPUTRACE macros to remove dependency on that system (they weren't really useful)
Improve StallDetector logging

#rb francis.hurteau
#jira none
#preflight /job/602195055cb1b300015c6218

#ROBOMERGE-SOURCE: CL 15361323 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v771-15082668)

[CL 15361335 by geoff evans in ue5-main branch]
2021-02-08 18:41:28 -04:00
Johan Berg
16a9acd716 [TraceLog] Move OnExit register later in boot
CallstackTrace was register a callback for OnExit during static init, but this callback could be overwritten due to initialization order. Move the registering later to fix this.

#rnx
#jira UE-107085
#rb paul.chipchase

[CL 15300711 by Johan Berg in ue5-main branch]
2021-02-03 15:18:47 -04:00
Marc Audy
cac1fe0019 Merge UE5/Release-Engine-Staging @ CL# 15299266 to UE5/Main
This represents UE4/Main @ CL# 15277572

[CL 15299962 by Marc Audy in ue5-main branch]
2021-02-03 14:57:28 -04:00
geoff evans
58022cbe85 Add StallDetector to Session Summary for Analytics
This adds some scalar statistics to the session summary:
* The total stall trigger count
* The total reported stalls
* The top stall name
* The top stall budget time in seconds
* The top stall cumulative overage time in seconds
* The top stall trigger count

#jira none
#rb patrick.laflamme, francis.hurteau
#preflight /job/6019a5ef797f69000126f9b6

[CL 15284567 by geoff evans in ue5-main branch]
2021-02-02 16:47:04 -04:00
Johan Berg
1e44893002 [TraceLog] Clean shutdown of callstack tracing worker thread
On process exit the worker thread is killed, but we need orderly shutdown to avoid dropped callstacks and deadlocks when allocating during static deinitialization.

#rb ionut.matasaru, martin.ridgers
#rnx
#jira UE-107085

[CL 15237564 by Johan Berg in ue5-main branch]
2021-01-28 07:15:32 -04:00
geoff evans
4d6be6faf1 Fix clang compile error. Clang's std::atomic copy ctor is deleted
#jira UE-107295
#rb trivial

[CL 15218141 by geoff evans in ue5-main branch]
2021-01-27 12:58:26 -04:00
geoff evans
4f72b503b8 Add Stall Detector API, enabled only for Editor builds for Windows
This code is meant to help locate and send reports/telemetry for slow code pathways that create unresponsive conditions
FGameThreadHitchHeartBeatThreaded was considered, but doesn't fit Editor's needs because its designed around general GameThread deadlines
Editor workloads are much less homogenous, and proper async support for a consistent GameThread deadline in Editor is a ways away
This necessitates a more focused approach where we can instrument specific routines such that each issue their own telemetry report
Add a "Stalls" counter in the Frame Rate and Memory title bar stats
Add LogStall Log category for viewing details about stalls that have occurred
Introduces a stall counter object on the GameThread to collect statistical data about stalls (this will not report to telemetry)
Future changes will introduce report objects into specific routines to upload to crashreporter
Future changes will introduce support for non-Windows OSes

#jira none
#rb francis.hurteau

[CL 15213394 by geoff evans in ue5-main branch]
2021-01-26 20:26:53 -04:00
Johan Berg
f16616d73b Fix for nonunity builds
#rb none
#rnx

[CL 15201567 by Johan Berg in ue5-main branch]
2021-01-26 04:48:20 -04:00
Johan Berg
7dfe9bb1c1 [Trace] Removed use of TMiniArray.
#rb martin.ridgers
#rnx

[CL 15162897 by Johan Berg in ue5-main branch]
2021-01-22 05:44:46 -04:00
Martin Ridgers
abc747fc2e Inform the user if trace.start was not possible. There exist some plugins that create their own trace store and sequester the runtime trace. As tracing is process wide this ties up the trace system such that other use-cases like trace.start can't be satisfied. When this scenario is encountered will inform the user and invite them to run trace.stop first.
#jira ue-104408
#rb jb

[CL 15162718 by Martin Ridgers in ue5-main branch]
2021-01-22 04:21:00 -04:00
Martin Ridgers
ae038f291d It is okay to call GAux.EnableChannels() directly here.
[CL 15153557 by Martin Ridgers in ue5-main branch]
2021-01-21 08:31:32 -04:00
Martin Ridgers
4b15ed3ce8 Squiggly bracket conformance.
[CL 15153532 by Martin Ridgers in ue5-main branch]
2021-01-21 08:27:57 -04:00
Martin Ridgers
27115359cf Flipped an include statement's backslash to a forward slash.
[CL 15148246 by Martin Ridgers in ue5-main branch]
2021-01-20 16:49:37 -04:00
Tim Smith
eeb9beb364 Fixing PVS 7.7 Issues:
warning V547: Expression 'XYZ' is always true/false.

#rb trivial
#jira UE-91644

[CL 15048627 by Tim Smith in ue5-main branch]
2021-01-12 10:01:09 -04:00
Catalin Dragoiu
4020586159 Callstack resolving for Insights initial commit
#rb none

[CL 14998219 by Catalin Dragoiu in ue5-main branch]
2021-01-06 05:44:12 -04:00
Martin Ridgers
bc0c5884da Removed truncation of callstack hashes to 47 bits. The original intention was to limit the bits to match those that are addressable and later save space in trace events. 47 bits has quite a high rish of collision though.
#rb trivial
#rnx

[CL 14973153 by Martin Ridgers in ue5-main branch]
2021-01-04 05:25:09 -04:00
Martin Ridgers
874c2f928d Cheap solution for Windows deadlocks when tracing memory from modular targets.
#rb none
#rnx

[CL 14971415 by Martin Ridgers in ue5-main branch]
2021-01-03 12:30:46 -04:00
Martin Ridgers
888586a320 Converted pass-by-value FNames to references. TagTrace.h is included so early it really cannot depend on any other headers otherwise it quickly ends in a circular loop. We need to forward declare as much as possible.
#rb jb
#rnx
#jira UE-104077

[CL 14913505 by Martin Ridgers in ue5-main branch]
2020-12-14 11:04:44 -04:00
Martin Ridgers
1f5ac596f7 Use PLATFORM_ macros for the address of the return address when determining owners of allocations.
#rb jb
#rnx

[CL 14904961 by Martin Ridgers in ue5-main branch]
2020-12-11 06:37:06 -04:00
Johan Berg
e5b085d743 Remove very noisy profiler scope
#rb none
#rnx

[CL 14853409 by Johan Berg in ue5-main branch]
2020-12-04 06:04:53 -04:00
Martin Ridgers
e2b24dd899 Assume that callers of FAllocationTrace::[Re]Alloc() will provide the precise alignment values that they wish to trace.
#rb jb
#rnx

[CL 14853402 by Martin Ridgers in ue5-main branch]
2020-12-04 06:02:09 -04:00
Martin Ridgers
f9055a6cd5 Fixed an error in a static_assert's logic and reduced some static assertion redundancy.
#rb jb
#rnx

[CL 14853399 by Martin Ridgers in ue5-main branch]
2020-12-04 06:00:03 -04:00
Johan Berg
b349cde7d9 Emit periodic alloc/free timestamp trace events.
#rb martin.ridgers

[CL 14853247 by Johan Berg in ue5-main branch]
2020-12-04 05:06:14 -04:00
Martin Ridgers
a09b9d44b7 A few no-unity include fixes.
#rb jb
#rnx

[CL 14834706 by Martin Ridgers in ue5-main branch]
2020-12-02 09:10:14 -04:00
geoff evans
af1784ca1d Add -tracefiletrunc cmdline option to allow for overwriting a trace named on the commane line.
This is desired for data center builds where we only care about one trace at a time, and uniquely naming or rotating the file name just makes for extra complexity and bug risk in calling code. Also, for incremental worker configurations we can leak disk consumption if we use a different file name every time.

Win/Mac/Linux all have the truncate file open flag set, so the platform file code should all allow for this.

Tested on windows.

#rb martin.ridgers, francis.hurteau

[CL 14828368 by geoff evans in ue5-main branch]
2020-12-01 11:46:13 -04:00