You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
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]
This commit is contained in:
+20
@@ -73,8 +73,14 @@ FTidPacketTransport::EReadPacketResult FTidPacketTransport::ReadPacket()
|
||||
// chance to sample the world at each known sync point.
|
||||
}
|
||||
|
||||
#if UE_TRACE_PACKET_VERIFICATION
|
||||
const bool bHasPacketSerial = !!(PacketBase->ThreadId & FTidPacketBase::Verification);
|
||||
FThreadStream* Thread = FindOrAddThread(ThreadId, true);
|
||||
#else
|
||||
bool bIsPartial = !!(PacketBase->ThreadId & FTidPacketBase::PartialMarker);
|
||||
FThreadStream* Thread = FindOrAddThread(ThreadId, !bIsPartial);
|
||||
#endif
|
||||
|
||||
if (Thread == nullptr)
|
||||
{
|
||||
return EReadPacketResult::Continue;
|
||||
@@ -149,6 +155,20 @@ FTidPacketTransport::EReadPacketResult FTidPacketTransport::ReadPacket()
|
||||
#endif // UE_TRACE_ANALYSIS_DEBUG
|
||||
}
|
||||
|
||||
#if UE_TRACE_PACKET_VERIFICATION
|
||||
if(bHasPacketSerial)
|
||||
{
|
||||
uint64 PacketSerial = *GetPointer<uint64>();
|
||||
if ((LastPacketSerial + 1) != PacketSerial)
|
||||
{
|
||||
UE_LOG(LogCore, Error, TEXT("Found packet with index '%llu' when '%llu` was expected."), PacketSerial, LastPacketSerial);
|
||||
return EReadPacketResult::ReadError;
|
||||
}
|
||||
LastPacketSerial = PacketSerial;
|
||||
FTransport::Advance(sizeof(uint64));
|
||||
}
|
||||
#endif
|
||||
|
||||
return EReadPacketResult::Continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -63,6 +63,9 @@ private:
|
||||
|
||||
protected:
|
||||
uint32 Synced = 0x7fff'ffff;
|
||||
#if UE_TRACE_PACKET_VERIFICATION
|
||||
uint64 LastPacketSerial = 0;
|
||||
#endif
|
||||
|
||||
#if UE_TRACE_ANALYSIS_DEBUG
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user