In order to avoid scopes ending up after thread end (rare) clear the thread buffer pointer. In that case a new thread buffer will created, specifically for that scope.
#rb ionut.matasaru
#preflight 61eaaff35f04f4cdf1bae9bd
#ROBOMERGE-AUTHOR: johan.berg
#ROBOMERGE-SOURCE: CL 18688576 in //UE5/Release-5.0/... via CL 18688580 via CL 18688590
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v903-18687472)
[CL 18688595 by johan berg in ue5-main branch]
Trace normally runs with a worker thread to write data regularly, however when `FPlatformProcess:SupportsMultithreading` was false we did not start the worker thread, instead we relied on EndFrame delegate to manually pump Trace. When tracing is very intense (e.g. memory tracing) could lead to data building up internally, up to 1 GB of data by the time the first frame callback came. We have recently added a special sync type packet in the stream to deal with edge cases related to late-connect, so analysis stalled until those came trough. However since the backlog of data has to be transmitted first, those sync packet ended up after the initial data. Analysis had to (very inefficiently) get trough that 1Gb of data before the first sync packet came through and events starts to appear.
With this change trace always start the worker thread (if we're intending to fork) regardless of the SupportsMultithreading setting.
#rb ionut.matasaru, ben.woodhouse
#ROBOMERGE-AUTHOR: johan.berg
#ROBOMERGE-SOURCE: CL 18675264 via CL 18675395 via CL 18675411 via CL 18675736 via CL 18675867 via CL 18675943
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v902-18672795)
[CL 18679793 by johan berg in ue5-main branch]
When starting a trace to a file, all relative paths should go to the Profiling directory, on Windows even paths that starts with '/'. Also cleaned up includes.
#rb ionut.matasaru
#jira UE-138824
#preflight 61e963e7817064a62d47ddc1
#ROBOMERGE-AUTHOR: johan.berg
#ROBOMERGE-SOURCE: CL 18673744 in //UE5/Release-5.0/... via CL 18673759 via CL 18673763
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v902-18672795)
[CL 18673770 by johan berg in ue5-main branch]
* 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]
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]
Append the default file name when the trace target path ends with a slash, for examplethe path "foo/bar/". The target trace file will then be "foo/bar/defaultname.utrace". Note that "foo/bar" will still target "foo/bar.utrace".
#jira UE-138824
#rb ionut.matasaru
#preflight 61e53ecd0c34e9a5ae5f838e
#ROBOMERGE-AUTHOR: johan.berg
#ROBOMERGE-SOURCE: CL 18631469 in //UE5/Release-5.0/... via CL 18631663 via CL 18631684
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v899-18417669)
[CL 18636673 by johan berg in ue5-main branch]
* Whenever starting a trace command (from the api or console command), reset the current command line list of channels.
* Don't assume default channels should be enabled if none are given. For command line arguments this will still be the case, but not console commands or the API.
* Emit log message when auto connecting.
#preflight 61e189669010dadd257b0e38
#ROBOMERGE-AUTHOR: johan.berg
#ROBOMERGE-SOURCE: CL 18617306 in //UE5/Release-5.0/... via CL 18617329 via CL 18617340
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v899-18417669)
[CL 18617352 by johan berg in ue5-main branch]
Implement additional memory tracing for many platforms to bring up parity with LLMs tracking.
#rb ionut.matasaru
#preflight 61e02b04341d372424d19559
#ROBOMERGE-AUTHOR: johan.berg
#ROBOMERGE-SOURCE: CL 18596048 in //UE5/Release-5.0/... via CL 18596070 via CL 18596080
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Test -> Main) (v899-18417669)
[CL 18596949 by johan berg in ue5-main branch]
Move code that reserved memory for callstack hashes used in callstack tracing to execute when used. Additionally add configuration options to allow platform specific values and behaviour.
#jira UE-137199
#rb ionut.matasaru
#preflight 61e02047341d372424d0ef7a
#ROBOMERGE-AUTHOR: johan.berg
#ROBOMERGE-SOURCE: CL 18595791 in //UE5/Release-5.0/... via CL 18595800 via CL 18595801
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Test -> Main) (v899-18417669)
[CL 18596759 by johan berg in ue5-main branch]
* Added 'Trace.Enable' and 'Trace.Disable' console commands to control channels.
* 'Trace.Start' is marked as deprecated in favor of Trace.File.
* For 'Trace.File' both arguments are now optional, and heuristic for detecting a file argument implemented.
* 'Trace.Stop' no longer disables channels.
* 'Trace.Pause/Resume' now keeps a list of the current active channels which will be restored. Logic for enabling channels has been separated from EnableChannels which is used in initialization sequence.
* Changed FChannel toggling to directly write the state. This change was done to reduce confusion around enabling/disabling channels and preset that overlaps.
* Refactored some methods internal to FTraceAuxilliaryImpl
#jira UE-136002
#preflight 61d80f13430de36baa590e55
#ROBOMERGE-OWNER: johan.berg
#ROBOMERGE-AUTHOR: johan.berg
#ROBOMERGE-SOURCE: CL 18540924 in //UE5/Release-5.0/... via CL 18540956
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v899-18417669)
[CL 18540960 by johan berg in ue5-release-engine-test branch]
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
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v897-18405271)
[CL 18445604 by ben woodhouse in ue5-release-engine-test branch]
Added console command to print status of trace to in game console. In order to list the available channels a enumeration method was added.
#rb martin.ridgers
#jira UE-136018
#preflight 61b32d0dc01c89f906dc3dbd
#ROBOMERGE-AUTHOR: johan.berg
#ROBOMERGE-SOURCE: CL 18429738 in //UE5/Release-5.0/... via CL 18429749
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v897-18405271)
[CL 18429751 by johan berg in ue5-release-engine-test branch]
* TraceMalloc should not use it's own root heap. Instead it will use a regular heap in system memory and make fake heaps (since we can't track virtual allocations for trace's own allocations).
* The first named was miscategorized as a root heap.
#rb ionut.matasaru
#ROBOMERGE-AUTHOR: johan.berg
#ROBOMERGE-SOURCE: CL 18417001 in //UE5/Release-5.0/... via CL 18417015
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v897-18405271)
[CL 18417028 by johan berg in ue5-release-engine-test branch]
* Adds special value reserved to Trace allocations
* Adds checks to avoid collisions between FName indices and ELLMTags.
#preflight 61af41ca353890ce23edcf36
#ROBOMERGE-AUTHOR: johan.berg
#ROBOMERGE-SOURCE: CL 18393722 in //UE5/Release-5.0/... via CL 18393732
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v896-18170469)
[CL 18393738 by johan berg in ue5-release-engine-test branch]