Commit Graph

618 Commits

Author SHA1 Message Date
ben woodhouse
a3ce2a49de Refactor CsvProfiler begin/end capture - move capture start/end logic into dedicated functions to make the logic easier to maintain
- Add metadata for capture duration
#rb john.huelin

[CL 34484069 by ben woodhouse in ue5-main branch]
2024-06-18 18:47:02 -04:00
ben woodhouse
d4460eb484 Add ProgramSizeMB metadata so we can capture this even when LLM isn't running
#rb mickael.gilabert

[CL 34462213 by ben woodhouse in ue5-main branch]
2024-06-18 11:15:43 -04:00
andrew ladenberger
639ccfcc0c [CsvProfiler] Optimized overhead by using the 1/frame cached memory stats, and reducing platform API calls.
#rb ben.woodhouse, dmytro.vovk

[CL 34445047 by andrew ladenberger in ue5-main branch]
2024-06-17 18:37:57 -04:00
ben woodhouse
2ea61ce0c6 Switch to CSV_PROFILER_STATS instead of CSV_PROFILER for various profiling subsystems. This allows them to be compiled out when CSV_PROFILER_MINIMAL is defined.
As part of this change we also promote dynamic resolution and IO/PackageQueueDepth stats to Minimal since they're important for high level performance reporting.
Also fix up a few places that were redundantly using #if CSV_PROFILER around CSV macros.

#rb mickael.gilabert

[CL 34386798 by ben woodhouse in ue5-main branch]
2024-06-14 18:16:47 -04:00
ben woodhouse
39d5c72b3f CsvProfiler: add float and int overloads for RecordCustomStatMinimal
[CL 34378844 by ben woodhouse in ue5-main branch]
2024-06-14 14:25:40 -04:00
ben woodhouse
5280549418 Add CSV_PROFILER_MINIMAL define for removing almost all instrumentation overhead. Only a handful of essential stats are captured; the rest are stripped out at compile time. In this mode, the only function which emits stats to the CSV is RecordCustomStatMinimal (with corresponding macros CSV_CUSTOM_STAT_MINIMAL and CSV_CUSTOM_STAT_MINIMAL_GLOBAL).
#rb mickael.gilabert
#tests Tested locally with and without the new cvar

[CL 34374708 by ben woodhouse in ue5-main branch]
2024-06-14 12:30:08 -04:00
danny couture
4206b2220b [TSAN]
- Fix TSAN warning in StallDetector

#rnx
#jira UE-215893
#rb kevin.macaulayvacher

[CL 34062959 by danny couture in ue5-main branch]
2024-06-03 07:55:19 -04:00
johan berg
9506deeb3c Rearrange TraceLog message types and emit fatal error for OOM.
Rearrange the order of messages so that the order goes from informational to increased seriousness and categorize by value. Also add a fatal category which implies catastrophic stop of the tracing application.

#rb ionut.matasaru

[CL 34062436 by johan berg in ue5-main branch]
2024-06-03 07:13:54 -04:00
catalin dragoiu
9f2576ec27 Fix Settings system for the Trace Control Window.
#rb ionut.matasaru, Johan.Berg
#jira UE-215072

[CL 34030625 by catalin dragoiu in ue5-main branch]
2024-05-31 08:44:06 -04:00
johan berg
a8a4029233 Include TagTrace directly to fix CIS error
#rb johan.berg

[CL 34010415 by johan berg in ue5-main branch]
2024-05-30 15:30:37 -04:00
johan berg
5e78a668c4 Tag Trace allocation with correct tag
#jira UE-210928
#rb johan.berg

[CL 34009015 by johan berg in ue5-main branch]
2024-05-30 14:43:13 -04:00
johan berg
06372458e4 Log TraceLog control port
When running multiple instances on one the same machine TraceLog searches for an open port to listen to control commands, but there was no way for the user to know which port each process ended up using. Add log entries that print the final listening port.


#jira UE-192404
#rb ionut.matasaru
#ushell-cherrypick of 26918370 by tuo.chen

[CL 34008304 by johan berg in ue5-main branch]
2024-05-30 14:23:10 -04:00
johan berg
d416ddd937 Correct how we now can return the original allocator from MemoryTrace_CreateInternal.
This fixes incorrectly trying to hook virtual memory allocators on Windows when memory tracing is disabled.

#rb johan.berg

[CL 33806404 by johan berg in ue5-main branch]
2024-05-21 15:45:11 -04:00
johan berg
0e7e066e2c Preset for "light" memory tracing
In some cases it could be useful to trace detailed allocations without callstack, and solely rely on tags for analysis. Enable by starting the process with `-trace=memory_light`.

#rb ionut.matasaru, dmytro.ivanov

[CL 33652379 by johan berg in ue5-main branch]
2024-05-15 03:43:13 -04:00
ben woodhouse
1c8ff02f83 Fail gracefully if we fail to allocate TLS data for the CSV profiler.
Fix a bug where IsValidTlsData doesn't work on some platforms
Speculative fix for OOM issues
#rb mickael.gilabert

[CL 33650215 by ben woodhouse in ue5-main branch]
2024-05-14 23:37:30 -04:00
johan berg
5c1a45f17d Extend support for using tracehost argument
Add a way to specify `-tracehost` argument without specifying a hostname, which will default to 'localhost'. Analog to how the file arguments work.

#rb ionut.matasaru

[CL 33572164 by johan berg in ue5-main branch]
2024-05-10 07:29:00 -04:00
tyler staples
d889c04af2 Fix Csv profiler using old metadata for new capture if end capture is called when no capture is in progress.
#rb ben.woodhouse
#tests verified the fix doing captures in PIE.

[CL 33363001 by tyler staples in ue5-main branch]
2024-04-30 21:39:09 -04:00
johan berg
8ee9d15fbe Trace message bus controls
Adds a control layer for Trace (TraceService) and a controller (TraceController) integrated into SessionServices. This allows remote control of trace over messge bus.

#rb Catalin.Dragoiu, ionut.matasaru, Josie.Yang

[CL 33260646 by johan berg in ue5-main branch]
2024-04-26 07:31:51 -04:00
carles fernandez
ef252c665e Exposed Trace.RegionBegin and Trace.RegionEnd commands.
These allow developers to tag regions of insights profiles manually with custom names, which can be useful when performing certain tests and then analyzing those results.

#rb ionut.matasaru, joe.bestrotheray, Sebastian.Thomeczek
#tests Tested in a local test build

[CL 33258578 by carles fernandez in ue5-main branch]
2024-04-26 04:34:45 -04:00
brandon schaefer
f437eff182 Fix FramePro, CpuProfiler for AutoRTFM
#rb Michael.Nicolella

[CL 33249752 by brandon schaefer in ue5-main branch]
2024-04-25 18:23:05 -04:00
anton dunchev
3ad6db2b3f [TRACE] Allow to disable callstack channel and not pay for backtrace overhead
#rb Johan.Berg
[FYI] simon.orr
#tests local

[CL 33109762 by anton dunchev in ue5-main branch]
2024-04-19 13:56:20 -04:00
rex hill
863d5535d2 Fix stall detector trying to report crashes as stalls then crashing.
Now shuts down stall detector when crash detected.
#jira UE-212420
#rb daniele.vettorel

[CL 33001673 by rex hill in ue5-main branch]
2024-04-16 11:10:05 -04:00
ben woodhouse
2bc93a5a49 Fix a wait stat push/pop mismatch. This would result in a crash if the CSV profiler started while another thread is inside a wait
#tests tested with a cooked build on multiple projects, preflighted

#rb john.huelin

[CL 32832875 by ben woodhouse in ue5-main branch]
2024-04-09 14:08:58 -04:00
ben woodhouse
67decc7152 Fix a race condition with TLS initialization on CsvProfiler startup where GCsvProfilerIsCapturing=true is visible on the renderthread before the initialization of TlsSlot. We could add a memory barrier in FCsvProfiler::Get() to ensure the variables are visible in the correct order from all threads, that but that would add overhead to every call, so instead we'll initialize the TLSSlot earlier (in CsvProfiler::Begin, rather than in the deferred command in FCsvProfiler::BeginFrame), ensuring a frame of separation.
#rb gwennael.arbona

[CL 32821978 by ben woodhouse in ue5-main branch]
2024-04-09 07:05:38 -04:00
danny couture
6df175be54 [BinnedMalloc2/3]
- Improve thread caches memory trimming behavior
 - No need to wake workers anymore to cleanup thread local memory caches
 - Refactor common code

#rb Dmytro.Vovk, Johan.Torp

[CL 32539789 by danny couture in ue5-main branch]
2024-03-27 07:24:58 -04:00