Commit Graph

293 Commits

Author SHA1 Message Date
johan berg
e9d5c48836 Fix TSAN warning in TraceLog
TSAN cannot reason about reading Cursor of the buffer before writing to EtxOffset, which is what releases the buffer to be reaped and eventually recycled. Read the cursor in atomic manner in order to appease TSAN.

#rb martin.ridgers
#jira UE-214738

[CL 34118491 by johan berg in ue5-main branch]
2024-06-05 04:33:42 -04:00
johan berg
a1ad9e77fa Disable TraceLog statistics when running with thread sanitizer
Synchronizing TraceLog statistics is not critical functionality and will introduce more complexity. Disables statistics reporting when thread sanitizer is enabled.
#jira UE-214111, UE-215211, UE-215183, UE-215185
#rb johan.berg

[CL 34118341 by johan berg in ue5-main branch]
2024-06-05 04:20:42 -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
brandon schaefer
e1cdd21b39 Disable AutoRTFM here as it does not depend on Core
[CL 34016882 by brandon schaefer in ue5-main branch]
2024-05-30 18:44:24 -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
michael nicolella
d719049833 autortfm: remove instrumentation from TraceLog
- TraceLog is intentionally meant to not depend on Core, but autortfm instrumentation requires Core
- if this causes issues with autortfm code, that stuff needs to be isolated from autortfm, outside of TraceLog itself
#rb Brandon.Schaefer, Markus.Breyer

[CL 33727798 by michael nicolella in ue5-main branch]
2024-05-17 12:43:06 -04:00
henrik karlsson
b250c11229 Changed so operator new/delete overloads are pulled in through a special include compiled in a generated cpp file that goes in its own translation unit. This will make it possible to support merging of modules and only include one of the .obj files for these overloads
If a module depends on Core and does not want the overloads it needs to add the private define SUPPRESS_PER_MODULE_INLINE_FILE or set PER_MODULE_INLINE_FILE to point to a different file

[CL 33709297 by henrik karlsson in ue5-main branch]
2024-05-16 22:34:40 -04:00
halfdan ingvarsson
ece738501a Trace: Revert change to atomics in Writer_GetThreadId
#rnx

[CL 33691774 by halfdan ingvarsson in ue5-main branch]
2024-05-16 12:56:19 -04:00
halfdan ingvarsson
dccc99e231 Trace: Avoid allocating a new TLS slot for every thread. Use std::atomic for Counter increments instead.
#rb ben.woodhouse, mickael.gilabert
#rnx

[CL 33675638 by halfdan ingvarsson in ue5-main branch]
2024-05-15 20:03:53 -04:00
johan berg
8de7dacd30 Fix for trace snapshots on platforms that use internal send buffers
On some platforms we use an internal send buffer to reduce network overheads. When a trace is active and a snapshot was triggerered the send buffer could be flushed while writing the snapshot, making the ongoing trace miss events. To fix this add a forced flush right before creating the snapshot handle.

#rb Martin.Ridgers
#jira UE-211694

[CL 33626357 by johan berg in ue5-main branch]
2024-05-14 07:27:01 -04:00
johan berg
4decca411b Add debug mode to serialized trace packets
By setting UE_TRACE_PACKET_VERIFICATION this mode embeds a serial numbers after each packet. Note that this makes analysis incompatible with traces recorded without this mode. Strictly useful for investigating potential package loss.

#rb ionut.matasaru

[CL 33598542 by johan berg in ue5-main branch]
2024-05-13 04:09:59 -04:00
johan berg
48a5211338 Expose channel ids
Channels have an internal uint32 id. Expose this when enumerating channels, and provide method to toggle channels by id.

#rb ionut.matasaru

[CL 33258172 by johan berg in ue5-main branch]
2024-04-26 03:49:16 -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
josh adams
aa9f467754 - More complex engine changes after plaform investigation
#rb Chris.Babcock, David.Harvey, Nicholas.Frechette

[CL 33101826 by josh adams in ue5-main branch]
2024-04-19 10:01:44 -04:00
johan berg
34f44669e2 No point in only forward declaring struct if users need to use it in function later.
#rb johan.berg

[CL 32997334 by johan berg in ue5-main branch]
2024-04-16 07:36:58 -04:00
ionut matasaru
37b8460820 [Insights]
- Removed function FChannel::EnumerateChannels deprecated since UE 5.2.
  - Fixed / updated comments for UE::Trace::FChannel class.
  - TraceAux: Made the warning message emitted when disabling a read only channel to be an error. Also update the error messages for enabling/disabling read only channels.
  - TraceAux: Fixed comments in TraceAuxiliary API.
  - TraceAux: Removed unused private function in TraceAuxiliary.
  - TraceAux: Minor refactoring / code cleanup.

#rb Johan.Berg

[CL 32248380 by ionut matasaru in ue5-main branch]
2024-03-14 12:28:28 -04:00
johan berg
849f7220ef Emit error message if redirect buffer is full
#rb ionut.matasaru

[CL 31985116 by johan berg in ue5-main branch]
2024-03-04 06:25:10 -05:00
david harvey
52f616c8e3 Clean up TRACE_PRIVATE_CONTROL_ENABLED for platform extensions
#jira UE-204162
#rnx
#rb Martin.Ridgers

[CL 31045198 by david harvey in ue5-main branch]
2024-01-31 09:00:59 -05:00
johan berg
aef269b790 Fix static analysis warnings
#rb ionut.matasaru

[CL 30270138 by johan berg in ue5-main branch]
2023-12-12 13:43:17 -05:00
johan berg
4f2700ace7 Account for complete event fitting in the buffer for scoped events.
If memory tracing is enabled we need to make sure that both the enter uid and the event header fits into the current buffer. Otherwise it's possible that while requesting a new buffer and one has to be allocated, allocation trace events are inserted between the enter uid and the event. The result is that allocation event is incorrectly marked as a scope.

#rb martin.ridgers, ionut.matasaru
#jira UE-200495

[CL 30259854 by johan berg in ue5-main branch]
2023-12-12 06:15:05 -05:00
ionut matasaru
78932cc969 Trace: Improved trace data writer to drain only the buffers available when we start draining buffers of a thread. This avoids cases where a thread floods the writer with new buffers.
#jira UE-196949
#rb Johan.Berg

[CL 30075687 by ionut matasaru in ue5-main branch]
2023-12-04 06:37:06 -05:00
ionut matasaru
119dbc1a08 Enabled UnsafeTypeCast warnings as errors in Trace/Insights related modules (UnrealInsights, TraceAnalysis, TraceServices, TraceDataFiltering, TraceUtilities, EditorTraceUtilities).
Fixed conversion warnings in TraceAnalysis and in TraceServices modules.

#rb Catalin.Dragoiu

[CL 28339045 by ionut matasaru in ue5-main branch]
2023-09-29 07:22:52 -04:00
henrik karlsson
7945247356 Header unit fixes (and disabling a few warnings)
[CL 28173546 by henrik karlsson in ue5-main branch]
2023-09-23 14:10:24 -04:00
henrik karlsson
d5bf11be3a Fixed for header units
#rb steve.robb

[CL 28171593 by henrik karlsson in ue5-main branch]
2023-09-23 02:37:45 -04:00
johan berg
5e350b4745 Remove false error message
Removing error message when reading from non-blocking sockets. This will return EAGAIN which is expected.

#rb none

[CL 27631511 by johan berg in ue5-main branch]
2023-09-06 08:51:09 -04:00