Commit Graph

328 Commits

Author SHA1 Message Date
Martin Ridgers
c76ba4fe18 Don't spawn the trace server if -buildmachine is present on the command line.
#rb cdp
#rnx
#ushell-cherrypick of 18032861 by Catalin.Dragoiu
#preflight 618cd047026d8c8fe93d14ee

[CL 18147522 by Martin Ridgers in ue5-main branch]
2021-11-11 03:41:25 -05:00
aurel cordonnier
fc542f6cfd Merge from Release-Engine-Staging @ 18081189 to Release-Engine-Test
This represents UE4/Main @18073326, Release-5.0 @18081140 and Dev-PerfTest @18045971

[CL 18081471 by aurel cordonnier in ue5-release-engine-test branch]
2021-11-07 23:43:01 -05:00
martin ridgers
7f6469353a Wrong CreateProcess() flag to pop out a debug console window.
#rnx

#ROBOMERGE-AUTHOR: martin.ridgers
#ROBOMERGE-SOURCE: CL 18048657 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v885-17909292)

[CL 18048709 by martin ridgers in ue5-release-engine-test branch]
2021-11-04 03:50:01 -04:00
aurel cordonnier
a6e741e007 Merge from Release-Engine-Staging @ 17915896 to Release-Engine-Test
This represents UE4/Main @17911760, Release-5.0 @17915875 and Dev-PerfTest @17914035

[CL 17918595 by aurel cordonnier in ue5-release-engine-test branch]
2021-10-25 20:05:28 -04:00
martin ridgers
718662ba87 -tracenocache command line option allowing users to optionall disable the caching of important trace events if they so wish.
#rb jb
#rnx

#ROBOMERGE-AUTHOR: martin.ridgers
#ROBOMERGE-SOURCE: CL 17857945 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v883-17842818)

[CL 17857961 by martin ridgers in ue5-release-engine-test branch]
2021-10-19 04:09:47 -04:00
aurel cordonnier
a12d56ff31 Merge from Release-Engine-Staging @ 17791557 to Release-Engine-Test
This represents UE4/Main @17774255, Release-5.0 @17791557 and Dev-PerfTest @17789485

[CL 17794212 by aurel cordonnier in ue5-release-engine-test branch]
2021-10-12 21:21:22 -04:00
aurel cordonnier
69fe095547 Merge from Release-Engine-Staging @ 17636544 to Release-Engine-Test
This represents UE4/Main @17638339 and Dev-PerfTest @17636504

[CL 17638842 by aurel cordonnier in ue5-release-engine-test branch]
2021-09-27 19:54:25 -04:00
jason hoerner
bec8237a32 UE5: Bug fix for infinite recursion when call stack tracing code is reentered due to an allocation within the code itself when memory tracking is enabled. Added flag to block further stack tracing when this case is detected. This wasn't observed in Development builds, because the reserve size was large enough that reallocation wasn't triggered, but in Test builds, additional functions are generated by the compiler.
#rb andrew.firth jeanfrancois.dube
#rnx
#lockdown andrew.firth
#preflight 6148fc96338ee5000126865d

#ROBOMERGE-OWNER: jason.hoerner
#ROBOMERGE-AUTHOR: jason.hoerner
#ROBOMERGE-SOURCE: CL 17576932 via CL 17634163
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v871-17566257)

[CL 17634172 by jason hoerner in ue5-release-engine-test branch]
2021-09-27 14:53:05 -04:00
martin ridgers
0cc47a4567 Fixed static analysis warnings.
#rb none
[FYI] johan.berg
#jira ue-127648
#rnx

#ROBOMERGE-AUTHOR: martin.ridgers
#ROBOMERGE-SOURCE: CL 17613749 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v871-17566257)

[CL 17613757 by martin ridgers in ue5-release-engine-test branch]
2021-09-23 16:51:10 -04:00
martin ridgers
248a63cc45 Missing include for no-unity or single-file compile.
#rb trivial
#rnx

#ROBOMERGE-AUTHOR: martin.ridgers
#ROBOMERGE-SOURCE: CL 17613610 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v871-17566257)

[CL 17613612 by martin ridgers in ue5-release-engine-test branch]
2021-09-23 16:38:40 -04:00
johan berg
184ac0c4f0 Fix backwards compatibility with older memory traces.
#rb ionut.matasaru
#rnx

#ROBOMERGE-AUTHOR: johan.berg
#ROBOMERGE-SOURCE: CL 17608069 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v871-17566257)

[CL 17608120 by johan berg in ue5-release-engine-test branch]
2021-09-23 10:34:18 -04:00
johan berg
98321a78e4 Memory tracing additional heaps
* Introduce the concept of heaps to memory tracing. A heap is defined a block of memory which can be used to host allocations. Heaps can be given descriptive names and belong to logical hierarchy. At the top of the hierarchy is one of 16 possible "root heaps". Currently the only two root heaps are system memory (virtual memory) and video memory (VRAM). If no root heap is specified for an allocation, system memory is assumed.
 * Remove the CoreAdd/CoreRemove events and replace them with Alloc + MarkAllocAsHeap events.
 * Introduce a public interface for tracing memory allocations.
 * Reduce the memory footprint of allocation events by changing the "Owner" field (hash or return address) into a "CallstackId" (running unique callstack counter). Additonally introduced a AllocSystem/AllocVideo specialized event which encodes the root heap in the message type. Total size of the event went from 21 bytes to 17 bytes/18 bytes.
 * Remove realloc scopes. These scopes comprised 50% of events during memory tracing, but the information can be reconstructed during analysis in the case of reallocations. The only other use case (in Level.cpp) was using the scope to maintain tag while copying from one array to another. For this use case we add a specific scope for pushing the tag of a specific pointer.

#rb ionut.matasaru
#preflight 614b0058a3310f000101cc42

#ROBOMERGE-AUTHOR: johan.berg
#ROBOMERGE-SOURCE: CL 17594699 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v871-17566257)

[CL 17594714 by johan berg in ue5-release-engine-test branch]
2021-09-22 08:36:16 -04:00
martin ridgers
dc2a0bfe13 An implementation of LaunchUnrealTrace() for POSIX platforms (currently disabled).
#rb jb
#preflight 6139c15648e495000141820c
#rnx

#ROBOMERGE-AUTHOR: martin.ridgers
#ROBOMERGE-SOURCE: CL 17469929 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v870-17433530)

[CL 17469934 by martin ridgers in ue5-release-engine-test branch]
2021-09-09 05:37:16 -04:00
martin ridgers
9a4471d2d6 Clarified that the shwon return value is in hexadecimal
#rb jb
#preflight 6139c15648e495000141820c
#rnx

#ROBOMERGE-AUTHOR: martin.ridgers
#ROBOMERGE-SOURCE: CL 17469908 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v870-17433530)

[CL 17469914 by martin ridgers in ue5-release-engine-test branch]
2021-09-09 05:36:27 -04:00
martin ridgers
b33b869a1d Swapped to a string-builder and adding missing TEXT() decoration around some literals
#rb jb
#preflight 6139c15648e495000141820c
#rnx

#ROBOMERGE-AUTHOR: martin.ridgers
#ROBOMERGE-SOURCE: CL 17469873 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v870-17433530)

[CL 17469885 by martin ridgers in ue5-release-engine-test branch]
2021-09-09 05:35:19 -04:00
martin ridgers
54d5ea36ea -traceshowstore to pop up the store server in its own console window. Useful for debugging.
#rb jb
#preflight 6139c15648e495000141820c
#rnx

#ROBOMERGE-AUTHOR: martin.ridgers
#ROBOMERGE-SOURCE: CL 17469847 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v870-17433530)

[CL 17469879 by martin ridgers in ue5-release-engine-test branch]
2021-09-09 05:35:03 -04:00
robert millar
eef73ebc8b Insights changes:
Make memory tag specs important so they don't get dropped before a trace connection is made.
Prevent Insights from crashing when opening a trace missing memory scopes or with missing scope specs.
Add a tooltip to symbol resolution noting the environment variable for symbol paths.
Allow Insights to capture full callstacks (including system modules) with the define UE_CALLSTACK_TRACE_FULL_CALLSTACKS or the command line argument -tracefullcallstacks on Windows.

#jira none
#rb ionut.matasaru, martin.ridgers

#ROBOMERGE-AUTHOR: robert.millar
#ROBOMERGE-SOURCE: CL 17461782 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v870-17433530)
#ROBOMERGE[bot1]: Dev-EngineMerge

[CL 17461823 by robert millar in ue5-release-engine-test branch]
2021-09-08 15:02:01 -04:00
aurel cordonnier
7f517562d5 Merge from Release-Engine-Staging @ 17438845 to Release-Engine-Test
This represents UE4/Main @17430120 and Dev-PerfTest @17437669

[CL 17439044 by aurel cordonnier in ue5-release-engine-test branch]
2021-09-06 12:23:53 -04:00
jason hoerner
110bd98b0a UE5: Optimizations when memory tracing is enabled: 5x perf increase with -llmcsv, 8x perf increase with -trace=memory.
#rb matt.peters johan.berg ionut.matasaru brandon.dawson jason.nadro
#rnx

Over half the perf gain was from reducing critical section locks, with the rest of the gains split between an optimization to call stack traversal (caching return address lookups in a lock free map), and enabling TLS related optimizations for MallocBinned2, which were inadvertently disabled when tracing was enabled (this also saves some locks).  Multiple lock types had to be optimized before measurable perf gains were observed, due to contention on remaining locks increasing as the first few locks were removed.  A total of 6 types of locks were removed or reduced:  AnnounceFNameTag, MallocBinned2, TagDataNameMap, Enum tag data lookup, Windows callstack trace, LLMMap.

* Added hash table utility class TGrowOnlyLockFreeHash which supports lock free reads, writes using a critical section, and no deletion.  This is intended for classes that represent caches of one-time initialized debug data used during memory tracing, which never needs to be freed.
* TGrowOnlyLockFreeHash applied to 4 sets/maps used when memory tracing is enabled, including tag data, announced tag names, call stack functions, and call stack IDs.
* Lock striping added to LLMMap.  This isn't a good candidate for a lock free approach, as it has a heavy amount of modification, and lock free approaches tend to perform worse than lock striping in that case, plus it would be a massive undertaking to make this lock free.
* A future lock to be removed would be the one in "FLowLevelAllocInfo::GetTag", protecting the "FLowLevelMemTracker::TagDatas" array, saving a couple percent more perf.
#preflight 6132a3a6bf137d00019a8c97

#ROBOMERGE-SOURCE: CL 17428762 via CL 17429451
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v865-17346139)

[CL 17429480 by jason hoerner in ue5-release-engine-test branch]
2021-09-03 20:58:47 -04:00
martin ridgers
9f66dcf36f Be explicit about the "fork" argument when launching the trace store server. Previously it was implicit preventing the addition of useful help text to anyone who ran the store binary explicitly. The process is also launched "detached" so that it can be in the console sub-system without popping up conhost terminals.
#rb johan.berg
#rnx
#preflight 6130519c79ce170001a93958

#ROBOMERGE-SOURCE: CL 17398147 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v865-17346139)

[CL 17398149 by martin ridgers in ue5-release-engine-test branch]
2021-09-02 01:46:57 -04:00
andrew firth
dfa71b7e39 [CSV] - add ExtendedUsedMB to the CSV output as a measure of the amount of extended memory currently in use.
[at]Ben.Woodhouse [at]Dave.Barrett
#rb Ben.Woodhouse
[FYI] nick.bullard
#preflight 612f969f6256b1000112e844

#ROBOMERGE-SOURCE: CL 17388268 via CL 17389243
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v865-17346139)

[CL 17389309 by andrew firth in ue5-release-engine-test branch]
2021-09-01 13:12:36 -04:00
martin ridgers
8ebbdc18f2 Specifying additional space for a traced event was only necessary if an event had an "attachment" (an arbitrary unstructured blob of data, "<< EventName.Attachment(...)"). Attachments were removed in 17080821. While the API wasn't updated at the time for transition purposes, it soon will be. (Note there is one slightly confusing element here which is that _important_ events do need to have a size specified due to the way they are buffered internally. The ThreadName events here however are not marked important).
[FYI] martins.mozeiko

#ROBOMERGE-SOURCE: CL 17365981 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v865-17346139)

[CL 17365987 by martin ridgers in ue5-release-engine-test branch]
2021-08-31 07:39:38 -04:00
martins mozeiko
dccdd9401b Collect process name & id for threads in context switches capture for Insights
#rb Ionut.Matasaru

#ROBOMERGE-SOURCE: CL 17323711 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v861-17282326)

[CL 17323725 by martins mozeiko in ue5-release-engine-test branch]
2021-08-26 14:51:46 -04:00
martins mozeiko
7343e55d12 Enable Windows ETW (context switches and stack sampling) and memory tracing on XSX.
Use Perf trace for context switches and stack sampling on PS4 and PS5.

#rb Ionut.Matasaru

#ROBOMERGE-SOURCE: CL 17277312 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v858-17259218)

[CL 17277323 by martins mozeiko in ue5-release-engine-test branch]
2021-08-23 17:40:14 -04:00
martins mozeiko
971132629e Add missing include for non unity build
#rb Ionut.Matasaru

#ROBOMERGE-SOURCE: CL 17141217 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v855-17104924)

[CL 17141245 by martins mozeiko in ue5-release-engine-test branch]
2021-08-11 15:42:39 -04:00