Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NetTrace file format doc doesn't match implementation #2137

Open
hoyosjs opened this issue Dec 12, 2024 · 0 comments
Open

NetTrace file format doc doesn't match implementation #2137

hoyosjs opened this issue Dec 12, 2024 · 0 comments

Comments

@hoyosjs
Copy link
Member

hoyosjs commented Dec 12, 2024

My guess is the implementation in trace event is actually right, but the spec says

- in either case, if MetadataId != 0 increment SequenceNumber by 1

Whereas the implementation only checks on metadata refs nullity in the case where the sequence flag isn't set:

if ((flags & (byte)CompressedHeaderFlags.CaptureThreadAndSequence) != 0)
{
header.SequenceNumber += (int)ReadVarUInt32(ref headerPtr) + 1;
header.CaptureThreadId = (long)ReadVarUInt64(ref headerPtr);
header.CaptureProcNumber = (int)ReadVarUInt32(ref headerPtr);
}
else
{
if(header.MetaDataId != 0)
{
header.SequenceNumber++;
}
}

Even though there's no guarantee that the sequence flag implies a non-mull metadata ID. Which one is correct? I assume the implementation is correct - otherwise the first event would have a negative seq number from what I've seen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant