-
Notifications
You must be signed in to change notification settings - Fork 748
Fix duplicate stringTable elements in instrumentation manifest #2347
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
base: main
Are you sure you want to change the base?
Conversation
Added HashSet tracking to prevent duplicate string IDs when generating stringTable entries in GetManifestForRegisteredProvider(). This prevents duplicates for keywords, tasks, opcodes, and enum map values. Co-authored-by: brianrob <[email protected]>
brianrob
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot, please address these comments.
Also, please add a new unit test that validates that the fix works. Use a provider that is known to exist on all machines, such as "Microsoft-Windows-DotNETRuntime". Please make sure that there are duplicates before the change and that after the change there aren't any duplicates. You don't need to keep a copy of the old code to ensure that there are duplicates each time - just do this check once so that we know we're dealing with a manifest that previously produced duplicates.
| manifest.WriteLine(" <keyword name=\"{0}\" message=\"$(string.keyword_{1})\" mask=\"0x{2:x}\"/>", | ||
| keyValue.Value, keyValue.Value, keyValue.Key); | ||
| localizedStrings.WriteLine(" <string id=\"keyword_{0}\" value=\"{1}\"/>", keyValue.Value, keyValue.Value); | ||
| string stringId = string.Format("keyword_{0}", keyValue.Value); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace new string.Format calls with string interpolation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replaced string.Format calls with string interpolation in commit a0fb478.
- Replace string.Format calls with string interpolation for stringId generation - Add RegisteredTraceEventParserTests with test for duplicate stringTable entries Co-authored-by: brianrob <[email protected]>
Addressed the string interpolation comment and added a new unit test |
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.