UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
NetTraceInternal.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
6#include "HAL/PlatformTime.h"
7
8namespace UE::Net::Private
9{
11 {
12 public:
13 FNetTimer(bool bEnabled)
14 : StartCycle(bEnabled ? FPlatformTime::Cycles64() : uint64(0))
15 {
16 }
17
18 uint64 GetCyclesSinceStart() const { return FPlatformTime::Cycles64() - StartCycle; }
19
20 private:
21 uint64 StartCycle;
22 };
23}
24
25
26#if UE_NET_TRACE_ENABLED
27
28#include "Containers/Array.h"
31#include "CoreTypes.h"
32#include "Misc/NetworkGuid.h"
34#include "UObject/NameTypes.h"
36
38
39// $TODO: Implement pooling of TraceCollectors
40// $TODO: Add disconnect reason to connection
41// $TODO: Add reporting of final packet sizes after packethandlers
42
43struct FBitReader;
44struct FBitWriter;
45namespace UE::Net
46{
47 class FNetBitStreamReader;
48 class FNetBitStreamWriter;
49}
50
55
57
59{
60 Object = 0,
61 NameId = 1,
62 BunchEvent = 2,
64};
65
66enum class ENetTracePacketType : uint8
67{
68 Outgoing = 0,
70};
71
73{
74 Packet = 0,
75 Frame = 1,
76};
77
79{
82 uint16 ConnectionId;
84};
85
86// Any changes to this struct must also be reflected on the NetTraceAnalyzer side and versioned
88{
89 struct
90 {
91 uint64 ChannelIndex : 20;
92 uint64 Seq : 12;
93 uint64 ChannelCloseReason : 4;
94 uint64 bPartial : 1;
95 uint64 bPartialInitial : 1;
96 uint64 bPartialCustomExportsFinal : 1;
97 uint64 bPartialFinal : 1;
98 UE_DEPRECATED(5.3, "Replication pausing is deprecated")
99 uint64 bIsReplicationPaused : 1;
100 uint64 bOpen : 1;
101 uint64 bClose : 1;
102 uint64 bReliable : 1;
103 uint64 bHasPackageMapExports : 1;
104 uint64 bHasMustBeMappedGUIDs : 1;
105 uint64 Padding : 18;
106 };
108};
109
111
113{
114 union
115 {
116 UE::Net::FNetDebugNameId DebugNameId;
119 };
120 struct
121 {
122 uint32 StartPos : 24;
123 uint32 EventType : 8;
124 uint32 EndPos : 24;
126 };
127};
128
129static_assert(sizeof(FNetTracePacketContentEvent) == 16U, "Unexpected size of PacketContentEvent");
130
136template <typename T>
138{
140public:
141
143
144 // When a scope is disabled due to verbosity we want to deffer the tracing of names
145 // We do this by using a lambda, this also allows us to complete eliminate statics if a scope is compiled out due to compile time verbosity
146 template <typename TraceNameFunctor>
148
150
153 void ExitScope();
154 bool IsValid() const;
155
156private:
157
159 T& Stream;
160 uint32 EventIndex;
161};
162
166template <typename T>
168{
170public:
171 template <typename SinkT>
174
177 void ExitScope() {};
178 bool IsValid() const { return false; }
179};
180
181struct FNetTrace
182{
183 enum { InvalidEventIndex = ~0U };
184
186 static bool IsEnabled() { return GetTraceVerbosity() > 0U; }
187
189 NETCORE_API static void SetTraceVerbosity(uint32 Verbosity);
190
191 static void OnTraceConnected();
192
193 static void OnTraceStopped(FTraceAuxiliary::EConnectionType TraceType, const FString& TraceDestination);
194
197
200
203
205 NETCORE_API static void TraceInstanceUpdated(uint32 GameInstanceId, bool bIsServer, const TCHAR* Name);
206
208 inline static uint32 GetTraceVerbosity() { return GNetTraceRuntimeVerbosity; }
209
212
214 inline static FNetTraceCollector* CreateTraceCollector(uint32 Verbosity);
215
218
221
224
227 NETCORE_API static void PopStreamOffset(FNetTraceCollector* Collector);
228
231
233 NETCORE_API static void EndPacketContentEvent(FNetTraceCollector& Collector, uint32 EventIndex, uint32 Pos);
234
237
239 NETCORE_API static void BeginBunch(FNetTraceCollector& Collector);
240
242 NETCORE_API static void DiscardBunch(FNetTraceCollector& Collector);
243
246
249
252
254 NETCORE_API static void PopSendBunch(FNetTraceCollector& Collector);
255
258
261
264
267
270
273
276
279
281 NETCORE_API static void TraceConnectionUpdated(uint32 GameInstanceId, uint32 ConnectionId, const TCHAR* AddressString, const TCHAR* OwningActor);
282
285
291
294
297
300
302 inline static UE::Net::FNetDebugNameId TraceName(const FString& Name) { return TraceName(ToCStr(Name)); };
303
304 NETCORE_API static void TraceObjectPolled(uint32 GameInstanceId, uint64 NetObjectId, uint64 Cycles, bool bIsDirty);
305
307
309
311
312 static bool constexpr GetNetTraceVerbosityEnabled(const uint32 V) { return (uint32)UE_NET_TRACE_COMPILETIME_VERBOSITY >= V; }
313
315
316 template<uint32 Verbosity, typename StreamType>
318 {
319 typedef std::conditional_t<FNetTrace::GetNetTraceVerbosityEnabled(Verbosity), FNetTraceEventScope<StreamType>, FNetTraceNullEventScope<StreamType> > Type;
320 };
321};
322
323template<typename T>
325{
326 static_assert(sizeof(T) == 0, "Not supported type for NetTraceObjectID, implement uint64 GetObjectIdForNetTrace(const T&)");
327 return 0;
328}
329
330inline uint64 GetObjectIdForNetTrace(const FNetworkGUID& NetGUID)
331{
332 return NetGUID.ObjectId;
333}
334
335template<typename T>
336FNetTraceBunchInfo MakeBunchInfo(const T& Bunch)
337{
339 BunchInfo.Value = uint64(0);
340 BunchInfo.ChannelIndex = Bunch.ChIndex;
341 BunchInfo.Seq = Bunch.ChSequence;
342 BunchInfo.ChannelCloseReason = uint64(Bunch.CloseReason);
343 BunchInfo.bPartial = Bunch.bPartial;
344 BunchInfo.bPartialInitial = Bunch.bPartialInitial;
345 BunchInfo.bPartialCustomExportsFinal = Bunch.bPartialCustomExportsFinal;
346 BunchInfo.bPartialFinal = Bunch.bPartialFinal;
348 BunchInfo.bIsReplicationPaused = Bunch.bIsReplicationPaused;
350 BunchInfo.bOpen = Bunch.bOpen;
351 BunchInfo.bClose = Bunch.bClose;
352 BunchInfo.bReliable = Bunch.bReliable;
353 BunchInfo.bHasPackageMapExports = Bunch.bHasPackageMapExports;
354 BunchInfo.bHasMustBeMappedGUIDs = Bunch.bHasMustBeMappedGUIDs;
355 BunchInfo.Padding = 0;
356
357 return BunchInfo;
358}
359
360// The purpose of a NetTraceCollector is to allow tracing of full packet content data with as low overhead as possible.
362{
364public:
365 // constants
366 enum { MaxNestingLevel = 32 };
367 enum { InlinedEventCount = 256 };
368 enum { InlinedObjectIdCount = 128 };
369
370 explicit FNetTraceCollector(uint32 InitialEventCount) { Events.SetNumUninitialized(InitialEventCount); Reset(); }
372
373 inline void Reset();
374
378
379private:
380 friend struct FNetTrace;
381
382 // Bookkeeping
385 uint32 EventCount;
388
389 // Bunch tracking
393
394 // Events
397
398 // Object Ids referenced by events
400};
401
405template <typename T>
407{
409public:
412
413private:
415 T& Bunch;
416 const uint32 StartPos;
417 const uint32 HeaderBits;
418};
419
424{
426public:
429
430private:
432};
433
435{
437 : Timer(InTimer)
440 {}
441
442 const UE::Net::Private::FNetTimer& Timer;
445};
446
448{
451 , bIsWaste(false) {}
452
454 {
455 if (GameInstanceId != -1)
456 {
457 FNetTrace::TraceObjectPolled(GameInstanceId, NetObjectId, Timer.GetCyclesSinceStart(), bIsWaste);
458 }
459 }
460
461 bool bIsWaste;
462};
463
465{
468 {}
469
471 {
472 if (GameInstanceId != -1)
473 {
474 FNetTrace::TraceObjectQuantized(GameInstanceId, NetObjectId, Timer.GetCyclesSinceStart());
475 }
476 }
477};
478
480{
483 {}
484
486 {
487 if (GameInstanceId != -1)
488 {
489 FNetTrace::TraceObjectWritten(GameInstanceId, NetObjectId, Timer.GetCyclesSinceStart());
490 }
491 }
492};
493
494// FNetTrace implementation
495FNetTraceCollector* FNetTrace::CreateTraceCollector(uint32 Verbosity)
496{
497 if (FNetTrace::GetNetTraceVerbosityEnabled(Verbosity))
498 {
499 return GNetTraceRuntimeVerbosity >= Verbosity ? FNetTrace::CreateTraceCollector() : nullptr;
500 }
501 else
502 {
503 return nullptr;
504 }
505}
506
507FNetTraceCollector* FNetTrace::GetCollectorAtVerbosity(FNetTraceCollector* Collector, uint32 CollectorVerbosity)
508{
510 {
511 return (FNetTrace::GetTraceVerbosity() >= CollectorVerbosity) ? Collector : nullptr;
512 }
513 else
514 {
515 return nullptr;
516 }
517}
518
519// FNetTraceEventScope implementation
520template <typename T>
521FNetTraceEventScope<T>::FNetTraceEventScope(uint64 InObjectId, T& InStream, FNetTraceCollector* InCollector, uint32 Verbosity)
524 , EventIndex(FNetTrace::InvalidEventIndex)
525{
526 if (Collector)
527 {
528 EventIndex = FNetTrace::BeginPacketContentEvent(*Collector, ENetTracePacketContentEventType::Object, GetBitStreamPositionForNetTrace(Stream));
529 Collector->EditEventNoCheck(EventIndex).ObjectId = InObjectId;
530 if (InObjectId != 0)
531 {
532 Collector->AddReferencedObjectId(InObjectId);
533 }
534 }
535}
536
537template <typename T>
538template <typename TraceNameFunctor>
539FNetTraceEventScope<T>::FNetTraceEventScope(TraceNameFunctor&& TraceNameFunc, T& InStream, FNetTraceCollector* InCollector, uint32 Verbosity)
542, EventIndex(FNetTrace::InvalidEventIndex)
543{
544 if (Collector)
545 {
546 EventIndex = FNetTrace::BeginPacketContentEvent(*Collector, ENetTracePacketContentEventType::NameId, GetBitStreamPositionForNetTrace(Stream));
547 Collector->EditEventNoCheck(EventIndex).DebugNameId = TraceNameFunc();
548 }
549}
550
551template <typename T>
552FNetTraceEventScope<T>::~FNetTraceEventScope()
553{
554 if (EventIndex != FNetTrace::InvalidEventIndex)
555 {
556 FNetTrace::EndPacketContentEvent(*Collector, EventIndex, GetBitStreamPositionForNetTrace(Stream));
557 }
558}
559
560template <typename T>
561void FNetTraceEventScope<T>::ExitScope()
562{
563 if (EventIndex != FNetTrace::InvalidEventIndex)
564 {
565 FNetTrace::EndPacketContentEvent(*Collector, EventIndex, GetBitStreamPositionForNetTrace(Stream));
566 EventIndex = FNetTrace::InvalidEventIndex;
567 }
568}
569
570template <typename T>
571void FNetTraceEventScope<T>::SetEventName(UE::Net::FNetDebugNameId NetTraceNameId)
572{
573 if (EventIndex != FNetTrace::InvalidEventIndex)
574 {
575 Collector->EditEventNoCheck(EventIndex).DebugNameId = NetTraceNameId;
576 }
577}
578
579template <typename T>
580void FNetTraceEventScope<T>::SetEventObjectId(uint64 ObjectId)
581{
582 if (EventIndex != FNetTrace::InvalidEventIndex)
583 {
584 Collector->EditEventNoCheck(EventIndex).ObjectId = ObjectId;
585 Collector->AddReferencedObjectId(ObjectId);
586 }
587}
588
589template <typename T>
590bool FNetTraceEventScope<T>::IsValid() const
591{
592 return EventIndex != FNetTrace::InvalidEventIndex;
593}
594
595// FNetTraceBunchScope implementation
596template <typename T>
597FNetTraceBunchScope<T>::FNetTraceBunchScope(T& InBunch, uint32 InStartPos, uint32 InHeaderBits, FNetTraceCollector* InCollector)
599, Bunch(InBunch)
600, StartPos(InStartPos)
602{
603 if (InCollector)
604 {
605 FNetTrace::BeginBunch(*InCollector);
606 }
607}
608
609template <typename T>
610FNetTraceBunchScope<T>::~FNetTraceBunchScope()
611{
612 // Only report if we have a valid collector
613 if (Collector)
614 {
615 FNetTrace::EndBunch(*Collector, FNetTrace::TraceName(Bunch.ChName), StartPos, HeaderBits, (uint32)Bunch.GetNumBits(), MakeBunchInfo(Bunch)); // LWC_TODO: Precision loss. FNetTrace::EndBunch et al. should take int64 BunchBits?
616 }
617}
618
619// FNetTraceOffsetScope implementation
620inline FNetTraceOffsetScope::FNetTraceOffsetScope(uint32 Offset, FNetTraceCollector* InCollector)
622{
623 if (Collector)
624 {
625 FNetTrace::PushStreamOffset(Collector, Offset);
626 }
627}
628
629inline FNetTraceOffsetScope::~FNetTraceOffsetScope()
630{
631 if (Collector)
632 {
633 FNetTrace::PopStreamOffset(Collector);
634 }
635}
636
637// FNetTraceCollector implementation
638void FNetTraceCollector::Reset()
639{
640 EventCount = 0U;
643 BunchEventCount = 0U;
645 OffsetStackLevel = 0U;
646 OffsetStack[0] = 0U;
647 ReferencedObjectIds.Reset();
648}
649
650#define UE_NET_TRACE_DO_IF(Cond, x) do { if (Cond) { x; } } while (0)
651
652// Internal macros wrapping all operations
653#define UE_NET_TRACE_INTERNAL_CREATE_COLLECTOR(Verbosity) (GNetTraceRuntimeVerbosity ? FNetTrace::CreateTraceCollector(Verbosity) : nullptr)
654#define UE_NET_TRACE_INTERNAL_DESTROY_COLLECTOR(Collector) UE_NET_TRACE_DO_IF(Collector, FNetTrace::DestroyTraceCollector(Collector))
655#define UE_NET_TRACE_INTERNAL_FLUSH_COLLECTOR(Collector, ...) UE_NET_TRACE_DO_IF(Collector, FNetTrace::TraceCollectedEvents(*Collector, __VA_ARGS__))
656#define UE_NET_TRACE_INTERNAL_BEGIN_BUNCH(Collector) UE_NET_TRACE_DO_IF(Collector, FNetTrace::BeginBunch(*Collector))
657#define UE_NET_TRACE_INTERNAL_DISCARD_BUNCH(Collector) UE_NET_TRACE_DO_IF(Collector, FNetTrace::DiscardBunch(*Collector))
658#define UE_NET_TRACE_INTERNAL_POP_SEND_BUNCH(Collector) UE_NET_TRACE_DO_IF(Collector, FNetTrace::PopSendBunch(*Collector))
659#define UE_NET_TRACE_INTERNAL_EVENTS(Collector, SrcCollector, Stream) UE_NET_TRACE_DO_IF(Collector, FNetTrace::FoldTraceCollector(Collector, SrcCollector, GetBitStreamPositionForNetTrace(Stream)))
660#define UE_NET_TRACE_INTERNAL_END_BUNCH(Collector, Bunch, ...) UE_NET_TRACE_DO_IF(Collector, FNetTrace::TraceBunch(*Collector, MakeBunchInfo(Bunch), __VA_ARGS__))
661#define UE_NET_TRACE_INTERNAL_BUNCH_SCOPE(Collector, Bunch, ...) FNetTraceBunchScope<decltype(Bunch)> PREPROCESSOR_JOIN(NetTraceBunchScope, __LINE__)(Bunch, __VA_ARGS__, Collector)
662
663#define UE_NET_TRACE_INTERNAL_SCOPE(Name, Stream, Collector, Verbosity) \
664 auto PREPROCESSOR_JOIN(NetTraceNameFunc_, __LINE__) = []() { static const UE::Net::FNetDebugName* Name = UE::Net::CreatePersistentNetDebugName(TEXT(#Name)); return FNetTrace::TraceName(Name); }; \
665 FNetTrace::TChooseTraceEventScope<Verbosity, decltype(Stream)>::Type PREPROCESSOR_JOIN(NetTraceScope, __LINE__)(PREPROCESSOR_JOIN(NetTraceNameFunc_, __LINE__), Stream, Collector, Verbosity)
666
667#define UE_NET_TRACE_INTERNAL_OBJECT_SCOPE(HandleOrNetGUID, Stream, Collector, Verbosity) \
668 FNetTrace::TChooseTraceEventScope<Verbosity, decltype(Stream)>::Type PREPROCESSOR_JOIN(NetTraceScope, __LINE__)(GetObjectIdForNetTrace(HandleOrNetGUID), Stream, Collector, Verbosity)
669
670#define UE_NET_TRACE_INTERNAL_DYNAMIC_NAME_SCOPE(Name, Stream, Collector, Verbosity) \
671 auto PREPROCESSOR_JOIN(NetTraceDynamicNameFunc_, __LINE__) = [&]() { return FNetTrace::TraceName(Name); }; \
672 FNetTrace::TChooseTraceEventScope<Verbosity, decltype(Stream)>::Type PREPROCESSOR_JOIN(NetTraceScope, __LINE__)(PREPROCESSOR_JOIN(NetTraceDynamicNameFunc_, __LINE__), Stream, Collector, Verbosity)
673
674#define UE_NET_TRACE_INTERNAL_NAMED_SCOPE(ScopeName, EventName, Stream, Collector, Verbosity) \
675 auto PREPROCESSOR_JOIN(NetTraceNameFunc_, __LINE__) = []() { static const UE::Net::FNetDebugName* Name = UE::Net::CreatePersistentNetDebugName(TEXT(#EventName)); return FNetTrace::TraceName(Name); }; \
676 FNetTrace::TChooseTraceEventScope<Verbosity, decltype(Stream)>::Type ScopeName(PREPROCESSOR_JOIN(NetTraceNameFunc_, __LINE__), Stream, Collector, Verbosity)
677
678#define UE_NET_TRACE_INTERNAL_NAMED_OBJECT_SCOPE(ScopeName, HandleOrNetGUID, Stream, Collector, Verbosity) \
679 FNetTrace::TChooseTraceEventScope<Verbosity, decltype(Stream)>::Type ScopeName(GetObjectIdForNetTrace(HandleOrNetGUID), Stream, Collector, Verbosity)
680
681#define UE_NET_TRACE_INTERNAL_NAMED_DYNAMIC_NAME_SCOPE(ScopeName, EventName, Stream, Collector, Verbosity) \
682 auto PREPROCESSOR_JOIN(NetTraceDynamicNameFunc_, __LINE__) = [&]() { UE::Net::FNetDebugNameId NameId = FNetTrace::TraceName(EventName); return NameId; }; \
683 FNetTrace::TChooseTraceEventScope<Verbosity, decltype(Stream)>::Type ScopeName(PREPROCESSOR_JOIN(NetTraceDynamicNameFunc_, __LINE__), Stream, Collector, Verbosity)
684
685#define UE_NET_TRACE_INTERNAL_SET_SCOPE_NAME(ScopeName, EventName) UE_NET_TRACE_DO_IF(ScopeName.IsValid(), ScopeName.SetEventName(FNetTrace::TraceName(EventName)))
686#define UE_NET_TRACE_INTERNAL_SET_SCOPE_OBJECTID(ScopeName, HandleOrNetGUID) UE_NET_TRACE_DO_IF(ScopeName.IsValid(), ScopeName.SetEventObjectId(GetObjectIdForNetTrace(HandleOrNetGUID)))
687#define UE_NET_TRACE_INTERNAL_EXIT_NAMED_SCOPE(ScopeName) ScopeName.ExitScope()
688#define UE_NET_TRACE_INTERNAL_OFFSET_SCOPE(Offset, Collector) FNetTraceOffsetScope PREPROCESSOR_JOIN(NetTraceOffsetScope, __LINE__)(Offset, Collector);
689
690#define UE_NET_TRACE_INTERNAL(Name, Collector, StartPos, EndPos, Verbosity) \
691 do { if (FNetTrace::GetCollectorAtVerbosity(Collector, Verbosity)) { \
692 static const UE::Net::FNetDebugName* PREPROCESSOR_JOIN(NetTraceNameId_, __LINE__) = UE::Net::CreatePersistentNetDebugName(TEXT(#Name)); \
693 FNetTrace::TracePacketContentEvent(*Collector, FNetTrace::TraceName(PREPROCESSOR_JOIN(NetTraceNameId_, __LINE__)), StartPos, EndPos, Verbosity); \
694 } } while (0)
695
696#define UE_NET_TRACE_INTERNAL_DYNAMIC_NAME(Name, Collector, StartPos, EndPos, Verbosity) UE_NET_TRACE_DO_IF(FNetTrace::GetCollectorAtVerbosity(Collector, Verbosity), FNetTrace::TracePacketContentEvent(*Collector, FNetTrace::TraceName(Name), StartPos, EndPos, Verbosity))
697#define UE_NET_TRACE_INTERNAL_ASSIGNED_GUID(GameInstanceId, NetGUID, PathName, OwnerId) UE_NET_TRACE_DO_IF(GNetTraceRuntimeVerbosity, FNetTrace::TraceObjectCreated(GameInstanceId, GetObjectIdForNetTrace(NetGUID), PathName, 0U, OwnerId))
698#define UE_NET_TRACE_INTERNAL_NETHANDLE_CREATED(Handle, DebugName, ProtocolId, OwnerId) FNetTrace::TraceObjectCreated(Handle.GetReplicationSystemId(), GetObjectIdForNetTrace(Handle), DebugName, ProtocolId, OwnerId)
699#define UE_NET_TRACE_INTERNAL_NETHANDLE_DESTROYED(Handle) FNetTrace::TraceObjectDestroyed(Handle.GetReplicationSystemId(), GetObjectIdForNetTrace(Handle))
700#define UE_NET_TRACE_INTERNAL_CONNECTION_CREATED(...) FNetTrace::TraceConnectionCreated(__VA_ARGS__)
701#define UE_NET_TRACE_INTERNAL_CONNECTION_STATE_UPDATED(...) FNetTrace::TraceConnectionStateUpdated(__VA_ARGS__)
702#define UE_NET_TRACE_INTERNAL_CONNECTION_UPDATED(...) FNetTrace::TraceConnectionUpdated(__VA_ARGS__)
703#define UE_NET_TRACE_INTERNAL_CONNECTION_CLOSED(...) FNetTrace::TraceConnectionClosed(__VA_ARGS__)
704#define UE_NET_TRACE_INTERNAL_PACKET_DROPPED(...) UE_NET_TRACE_DO_IF(GNetTraceRuntimeVerbosity, FNetTrace::TracePacketDropped(__VA_ARGS__))
705#define UE_NET_TRACE_INTERNAL_PACKET_SEND(...) UE_NET_TRACE_DO_IF(GNetTraceRuntimeVerbosity, FNetTrace::TracePacket(__VA_ARGS__, ENetTracePacketType::Outgoing))
706#define UE_NET_TRACE_INTERNAL_PACKET_RECV(...) UE_NET_TRACE_DO_IF(GNetTraceRuntimeVerbosity, FNetTrace::TracePacket(__VA_ARGS__, ENetTracePacketType::Incoming))
707
708#define UE_NET_TRACE_INTERNAL_PACKET_STATSCOUNTER(GameInstanceId, ConnectionId, Name, StatValue, Verbosity) \
709 do { if (FNetTrace::GetNetTraceVerbosityEnabled(Verbosity)) { \
710 static const UE::Net::FNetDebugName* PREPROCESSOR_JOIN(NetTraceNameId_, __LINE__) = UE::Net::CreatePersistentNetDebugName(TEXT(#Name)); \
711 FNetTrace::TracePacketStatsCounter(GameInstanceId, ConnectionId, FNetTrace::TraceName(PREPROCESSOR_JOIN(NetTraceNameId_, __LINE__)), StatValue); \
712 } } while (0)
713
714#define UE_NET_TRACE_INTERNAL_FRAME_STATSCOUNTER(GameInstanceId, Name, StatValue, Verbosity) \
715 do { if (FNetTrace::GetNetTraceVerbosityEnabled(Verbosity)) { \
716 static const UE::Net::FNetDebugName* PREPROCESSOR_JOIN(NetTraceNameId_, __LINE__) = UE::Net::CreatePersistentNetDebugName(TEXT(#Name)); \
717 FNetTrace::TraceFrameStatsCounter(GameInstanceId, FNetTrace::TraceName(PREPROCESSOR_JOIN(NetTraceNameId_, __LINE__)), StatValue); \
718 } } while (0)
719
720#define UE_NET_TRACE_INTERNAL_END_SESSION(GameInstanceId) FNetTrace::TraceEndSession(GameInstanceId);
721#define UE_NET_TRACE_INTERNAL_UPDATE_INSTANCE(...) FNetTrace::TraceInstanceUpdated(__VA_ARGS__)
722
723 #define UE_NET_TRACE_INTERNAL_POLL_OBJECT_SCOPE(Handle, Timer) FNetTraceObjectPollTimer __NetTracePollTimer(Timer, (GNetTraceRuntimeVerbosity >= ENetTraceVerbosity::VeryVerbose && Handle.IsValid()) ? Handle.GetReplicationSystemId() : -1, Handle.GetId());
724#define UE_NET_TRACE_INTERNAL_POLL_OBJECT_IS_WASTE __NetTracePollTimer.bIsWaste = true;
725#define UE_NET_TRACE_INTERNAL_QUANTIZE_OBJECT_SCOPE(Handle, Timer) FNetTraceObjectQuantizeTimer PREPROCESSOR_JOIN(__NetTraceQuantizeTimer, __LINE__)(Timer, (GNetTraceRuntimeVerbosity >= ENetTraceVerbosity::VeryVerbose && Handle.IsValid()) ? Handle.GetReplicationSystemId() : -1, Handle.GetId());
726#define UE_NET_TRACE_INTERNAL_WRITE_OBJECT_SCOPE(Handle, Timer) FNetTraceObjectWriteTimer PREPROCESSOR_JOIN(__NetTraceWriteTimer, __LINE__)(Timer, (GNetTraceRuntimeVerbosity >= ENetTraceVerbosity::VeryVerbose && Handle.IsValid()) ? Handle.GetReplicationSystemId() : -1, Handle.GetId());
727
728#define UE_NET_TRACE_INTERNAL_SUBOBJECT(ParentHandle, SubObjectHandle) FNetTrace::TraceSubObject(ParentHandle.GetReplicationSystemId(), GetObjectIdForNetTrace(ParentHandle), GetObjectIdForNetTrace(SubObjectHandle))
729
730#endif // UE_NET_TRACE_ENABLED
#define UE_NONCOPYABLE(TypeName)
Definition CoreMiscDefines.h:457
#define UE_DEPRECATED(Version, Message)
Definition CoreMiscDefines.h:302
uint32 GetBitStreamPositionForNetTrace(const FBitWriter &Stream)
Definition CoreNet.h:442
FPlatformTypes::TCHAR TCHAR
Either ANSICHAR or WIDECHAR, depending on whether the platform supports wide characters or the requir...
Definition Platform.h:1135
FPlatformTypes::uint64 uint64
A 64-bit unsigned integer.
Definition Platform.h:1117
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define DECLARE_TS_MULTICAST_DELEGATE(DelegateName)
Definition DelegateCombinations.h:26
#define PRAGMA_ENABLE_DEPRECATION_WARNINGS
Definition GenericPlatformCompilerPreSetup.h:12
#define PRAGMA_DISABLE_DEPRECATION_WARNINGS
Definition GenericPlatformCompilerPreSetup.h:8
UE_FORCEINLINE_HINT const UE_STRING_CLASS::ElementType * ToCStr(const UE_STRING_CLASS &Str)
Definition UnrealString.h.inl:2326
uint32 Offset
Definition VulkanMemory.cpp:4033
uint8_t uint8
Definition binka_ue_file_header.h:8
uint16_t uint16
Definition binka_ue_file_header.h:7
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition NameTypes.h:617
Definition NetworkGuid.h:12
uint64 ObjectId
Definition NetworkGuid.h:19
EConnectionType
Definition TraceAuxiliary.h:78
Definition Array.h:670
Definition NetBitStreamReader.h:11
Definition NetBitStreamWriter.h:11
Definition NetTraceInternal.h:11
FNetTimer(bool bEnabled)
Definition NetTraceInternal.h:13
uint64 GetCyclesSinceStart() const
Definition NetTraceInternal.h:18
bool IsEnabled()
Definition IAudioLinkFactory.cpp:13
Type
Definition PawnAction_Move.h:11
Definition NetworkVersion.cpp:28
Definition NetworkVersion.cpp:28
uint64 GetObjectIdForNetTrace(const FNetRefHandle &Handle)
Definition NetRefHandle.h:87
uint32 FNetDebugNameId
Definition NetDebugName.h:14
@ Events
Definition Transport.h:24
@ Packet
Definition Transport.h:15
@ false
Definition radaudio_common.h:23
U16 Index
Definition radfft.cpp:71
Definition AndroidPlatformTime.h:18
static uint64 Cycles64()
Definition AndroidPlatformTime.h:34
Definition BitReader.h:25
Definition BitWriter.h:22
Definition NetDebugName.h:17