[ActivityInfo] Avoid writing extra byte by updating length#109132
Merged
mdh1418 merged 1 commit intodotnet:mainfrom Oct 23, 2024
Merged
[ActivityInfo] Avoid writing extra byte by updating length#109132mdh1418 merged 1 commit intodotnet:mainfrom
mdh1418 merged 1 commit intodotnet:mainfrom
Conversation
Member
Author
|
It seems like the GUID optimization logic (squeeze as much info into as few bits as possible by coupling an odd-numbered nibble Id's highest order nibble with the multicode indicator nibble) only occurs for IDs in [0x0, 0xF] u (0xFF, 0xFFF], but not for (0xFFFF, 0xFFFFF]. Is it worth extending the optimization to (0xFFFF, 0xFFFFF] Ids or do Ids not reach those values? |
This was referenced Oct 23, 2024
Member
I wouldn't worry about extending it further. I don't recall ever seeing a complaint related to it and if we did extend it that would break compat with PerfView's decoding of the current scheme. |
noahfalk
approved these changes
Oct 23, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #109078
It was discovered that in some scenarios, the ActivityTracker.AddIdToGuid method's optimization logic fails to update the number of encoded bytes counter for (0xFF, 0xFFF] IDs. As a result, an extra 0x00 byte is encoded in the Guid, which is interpreted as the end of the list.
This PR updates the
lenvariable accordingly, so only one byte is written after bundling the (0xFF, 0xFFF] ID's 4 high order bits into the multicode indicating byte.Before
1/4/2000/1->14c7d00010After
1/4/2000/1->14c7d010