-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Remove AnonymousType ILLinkTrim entry for EventSource #37083
Conversation
Instead of using an anonymous type to do the logging, just pass the string directly. Contributes to dotnet#35199
I'm not actually sure this will work for tracelogging style events. Were you able to confirm that ETW events produced via this path are consumable? |
I'm not sure how to test that. Can you tell me? I did run the As far as I can tell, this path is only used in error cases in |
As you point out, this is used for error paths, so what you'll want to do is trigger an error and then make sure that the error event and any subsequent events can be properly parsed. Here's a test that you can use: https://github.com/brianrob/tests/tree/master/managed/eventsource_error. Before you run the test, make sure that you're capturing a trace using the following command:
Once the app completes (should be quite fast), stop collection and open the The key is that both the error message and the Let me know if you run into any issues with this and I can help. |
That test worked with my change Note that I changed "Hello World" to be From what I can tell, the reason this works is because |
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.
LGTM
dotnet#36715 and dotnet#37083 modified the CoreCLR version of CoreLib's linker descriptor file, but left them in the Mono version. dotnet#37255 will address sharing the duplicated parts of these files.
Instead of using an anonymous type to do the logging, just pass the string directly.
Contributes to #35199
It seems reasonable to allow a
string
to be used as a top-level object in an event, and changeStringTypeInfo
to use"message"
as the name of the field. Thoughts?I tried a different approach to fixing this. However, that approach ran into dotnet/linker#1218, which prevented it from working. If you prefer to wait for the linker to fix this and use that approach, let me know.