278 Commits

Author SHA1 Message Date
ionut matasaru
99661dcfdb [Insights] CpuProfilerTrace:
- Enabled cpu scope tracing of object names (blueprints, functions) by default when app is not running as a commandlet (still requires "cpu" trace channel and -statnamedevents to be enabled). Enabling AssetLoadTime trace channel will enable tracing of object names also in commandlets (ex. cooking).
  - Improved performance when tracing "statnamedevents" cpu scopes (by using a new optimized code path that uses an FName stat id together with a TCHAR* descriptive name).

#jira FORT-532106
#rb Matt.Peters

[CL 26814181 by ionut matasaru in 5.3 branch]
2023-08-03 12:16:00 -04:00
ben woodhouse
fcb84d5988 CSV Profiler: insights support for -csvNamedEvents
Also add a CSV_  prefix to csv named events so they can be distinguished from ordinary named events
#rb robert.millar

[CL 26144662 by ben woodhouse in 5.3 branch]
2023-06-21 07:06:27 -04:00
henrik karlsson
980d216f6d [Core]
* Moved dllexport from type to methods/staticvar. This improves compile times, memory and performance in dll builds

#rb

[CL 26081870 by henrik karlsson in 5.3 branch]
2023-06-17 16:03:04 -04:00
martin ridgers
6217ad3be3 Trace counter Get() on atomic ints would return reference to local due to implicit cast.
When fixing the Get() I also discovered a couple of counters where the storage template type was incorrectly the same as the value template type. Fixed to use the atomic counter type given in counters header.

#jira
#rb jb
#rnx

[CL 25910796 by martin ridgers in ue5-main branch]
2023-06-10 09:56:10 -04:00
Johan Berg
b22fd87d5d Change TraceAuxilliary internal management of tracing status and trace destination
* Removed internal state tracking connection status. This was causing many problems because connections could be severed inside TraceLog without TraceAuxiliary knowing about it causing a mismatch in state.
* Wrapped trace destination and connection type state in struct and added guards for thread safety.
* Deprecated method to access trace destination as char array.
#preflight 647721f9947ff6973c8b4bb0

[CL 25699206 by Johan Berg in ue5-main branch]
2023-05-31 06:51:39 -04:00
mickael gilabert
4a488a2b6e Added FTraceAuxiliary::Panic that disables all channels without logging. Needed on some platforms to make sure no trace code will be executed in their crash handling code
[REVIEW] [at]johan.berg
#rnx
#preflight 646261bacf788a25583d6d45

[CL 25480438 by mickael gilabert in ue5-main branch]
2023-05-15 17:09:10 -04:00
Johan Berg
fc90e54b74 Expose is connected in interface
Exposes a variant of the the IsConnected method that also outputs the current session and trace guid. Also prints the current session and trace guids in the status message.

#rb martin.ridgers
#rnx
#preflight 6458b30e9f47682963d55ad4

[CL 25368367 by Johan Berg in ue5-main branch]
2023-05-08 04:46:26 -04:00
robert millar
04d707b190 Move CPUPROFILERTRACE_FILE_AND_LINE_ENABLED to cpp file so it can be toggled without a full rebuild
#rb ionut.matasaru,johan.berg

[CL 25192000 by robert millar in ue5-main branch]
2023-04-25 19:19:56 -04:00
ionut matasaru
c04fc14767 Removed the deprecated MemoryProfiler runtime:
* Removed code switched by USE_MALLOC_PROFILER.
* Removed the USE_MALLOC_PROFILER define and the MALLOC_PROFILER macro.
* Removed PLATFORM_RUNTIME_MALLOCPROFILER_SYMBOLICATION define.
* Removed FMallocProfilerEx and FMallocProfilerEx wrappers and the GMallocProfiler global variable.
* Removed console commands: "MPROF", "DUMPALLOCSTOFILE", "SNAPSHOTMEMORY" and "SNAPSHOTMEMORYFRAME".
Please use Unreal Insights (Memory Insights; -trace=memory) instead.

#jira UE-141779
#rb Johan.Berg
#preflight 6437f5dd00398d6f88b5b18f

[CL 25101805 by ionut matasaru in ue5-main branch]
2023-04-19 04:07:55 -04:00
ben woodhouse
8d96709ed3 Add a OnCSVProfileEndFrame delegate, called only when the CSV profiler is running.
[CL 25049314 by ben woodhouse in ue5-main branch]
2023-04-14 16:35:54 -04:00
ben woodhouse
90d3f15fd4 CSVProfiler - duplicate start/stop capture hardening
- Detect duplicate start/stop capture requests. If a Start or Stop request is already pending as the next command in the queue, disregard repeat requests and emit a warning. This avoids an edge case where duplicate EndCapture calls would cause old metadata to be emitted
- Add IsEndCapturePending() method so calling code can check if there's a pending EndCapture before calling EndCapture (instead of just checking IsCapturing, which will be true if an EndCapture is pending).

[CL 25018952 by ben woodhouse in ue5-main branch]
2023-04-12 19:30:16 -04:00
robert millar
315d3013c6 Fix mismatched block comment.
#rb none

[CL 24920947 by robert millar in ue5-main branch]
2023-04-04 19:19:47 -04:00
robert millar
8598e0e047 Stall detector refactor
- Minimize duration of locks around FStallDetector and FStallDetectorStats instances
- Remove some public access to FStallDetector and FStallDetectorStats instances and synchronization around them
- Remove Stat from UE::FStallDetectorStats::TabulatedResult for thread safety in case of stat lifetime ending (e.g. thread shutdown)
- Fire callbacks & call ReportStall outside of locks
- Add backtrace to stall detected callback
- Only fire 'stall detected' from background thread, only fire 'stall completed' from stalling thread
- Change delegates to threadsafe versions
- Add checks for length of stall scope name
- Execute ReportStall in a task

#rb francis.hurteau,logan.buchy
#jira UE-179587

[CL 24920944 by robert millar in ue5-main branch]
2023-04-04 19:19:41 -04:00
ionut matasaru
efd620e3db Fixed ASan alloc-dealloc-mismatch for TCounters with dynamic name. Also fixed the case where id for a counter with dynamic name is correctly initialized in constructor (no string copy is allocated, but destructor was attempting to free the name string).
#jira UE-182242
#rb trivial
#rnx
#preflight 642c5b1f1d19c0312ac7bd2c

[CL 24914065 by ionut matasaru in ue5-main branch]
2023-04-04 13:51:09 -04:00
ionut matasaru
d05eeabdc2 Added comment about expected write size for FTraceUtils::Encode7bit
#rb trivial
#rnx
#preflight none

[CL 24871110 by ionut matasaru in ue5-main branch]
2023-03-31 10:29:43 -04:00
ionut matasaru
4a80dc42f1 [Insights] CountersTrace: Added explicit support for counters with dynamic name.
#jira UE-181611
#rb Johan.Berg
#preflight 64268ffa38075fa13f2eaf2f

[CL 24869338 by ionut matasaru in ue5-main branch]
2023-03-31 07:26:59 -04:00
ionut matasaru
60cd980cd0 [Insights] Fix late connect for the Counters trace channel.
#jira UE-181016
#rb Johan.Berg
#preflight 6421b64d7703a8de3da002a6

[CL 24820422 by ionut matasaru in ue5-main branch]
2023-03-28 11:55:43 -04:00
leigh mcrae
f79f51b101 Moves untracked memory coming from the third party Eigen library into the UE allocators, making it trackable.
- Originally was added in CL24689238 but had to be removed for Static Analysis violation of an external file including a non-external file.
  - Added EIGEN_UE_OVERRIDE_ALLOCATORS that define EIGEN_STD_MALLOC and EIGEN_STD_FREE.
  - Moved FORCE_ANSI_ALLOCATOR from UMemoryDefines to Build.h because it needs to be defined earlier, also this seems to be where other defines like this live.

  - Also tried to use stubs I made in Core but it had problems with CORE_API.
    - Some builds were having problems with order and CORE_API was being defined to DLLIMPORT but DLLIMPORTwasn't always defined yet.

  - New version actually follows the pattern used to override the new operators by using the module boilerplate macro.
    - This will insert a copy of the stub function into each module which is fine since there will only be one version of FMemory.

#tests Built pretty much all targets (as non-unity also). Tested that allocations were going through the stub in Win64. Did as many Horde targets as I could.
[REVIEW] [at]dmytro.vovk [at]robert.millar [at]alex.nischwitz

[CL 24772972 by leigh mcrae in ue5-main branch]
2023-03-23 21:43:32 -04:00
logan buchy
3d7aaddad3 A subsystem to bubble up notifications from the StallDetector
* The subsystem adds a new toolbar widget in the level editor which changes to a notified state when a stall is detected.
* Clicking the widget brings up a tab with a table of the detected stall history.  Each stall has some information that can be copied to a clipboard for users to dump the data into a issue ticket or chat message.
* NOTE: Currently iconography is all placeholders. Need UX pass to improve.

#jira UE-174529
#rb Brooke.Hubert
#preflight 6414f70632723d4a2081491c
#preflight 64189fb032723d4a204d20ac

[CL 24724541 by logan buchy in ue5-main branch]
2023-03-20 17:36:50 -04:00
Johan Berg
44a07fc101 Add package field to asset metadata tracing.
Add a package field to the asset metadat scope, in addition to the existing asset name and object class fields.

#rb ionut.matasaru, josie.yang
#jira UE-157322
#preflight 64130a87a62aae9c87fa4c19
#preflight 641321e2760ee6afab7829b1

[CL 24670895 by Johan Berg in ue5-main branch]
2023-03-16 10:29:26 -04:00
ionut matasaru
33788a9f5c [Insights] MetadataTrace: Added UE_TRACE_METADATA_RESTORE_SCOPE(MetadataId) macro. Also did minor fixes to comments and code style.
#rb none
#fyi Johan.Berg
#preflight 6410974a924023147d3e69eb

[CL 24639983 by ionut matasaru in ue5-main branch]
2023-03-14 13:53:45 -04:00
Josie Yang
0c57354914 Insight asset meta data tracking on DX12 textures
#jira UE-167815
#rb ionut.matasaru, Kenzo.Terelst
#preflight 640634663206d45d202411c5

[CL 24610626 by Josie Yang in ue5-main branch]
2023-03-13 07:12:41 -04:00
Sebastian Thomeczek
dc2cf85e53 [Insights] Update Regions code to use custom trace events instead of hijacking regular bookmarks
#rb Ionut.Matasaru
#jira UE-148203
#preflight 64072d276e1dadfcda7352c9
#preflight 640731e4ba12ba641681363a

[CL 24538562 by Sebastian Thomeczek in ue5-main branch]
2023-03-07 08:00:11 -05:00
tyler staples
bf09d60d6b Add non-persistent metadata to the CsvProfiler.
By default csv metadata persists between captures which may be problematic if capturing different modes that have specific metadata since prior captures can pollute future ones.
This change adds a CSV_NON_PERSISTENT_METADATA macro which sets metadata that is cleared once the current capture ends.

For sake of review I've included the change to the FortLevelSaveComponent to update the creative metdata to use this macro. This will be submitted separately though.

#rb ben.woodhouse
[FYI] andrew.ladenberger

[CL 24436772 by tyler staples in ue5-main branch]
2023-02-27 20:55:32 -05:00
jian ru
a068006c5d Generalized templates for allcoation recording to and playback from log files
#rb dmytro.vovk, ben.woodhouse

[CL 24175227 by jian ru in ue5-main branch]
2023-02-13 10:38:26 -05:00