-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Developers can employ EventSource APIs when publishing for AOT targets to be able to use .NET tracing capabilities #43390
Comments
EventSource used to have a hookup point for this that was used in .NET Native. It looked like this: runtime/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs Lines 646 to 663 in dbcea6b
It was nuked in the meantime (latest sources don't have it anymore). |
How would this be consumed by non C# languages? |
It would affect all the EventSources in the runtime and aspnet so all languages would get benefits (reduced startup; increased trimability etc)
Whether or not you enable the EventSources they do a reflection based initialization step to see whether they are Enabled; which is expensive in startup. It will also mean exposing runtime apis for EventSources that other languages can use if they also wish to implement similar source generators; or can manually use. |
On top of the benefits with framework event sources mentioned by @benaadams, this could be used for any other event source as well. If the API is exposed as public any language could be used to implement it. For the C# source generator to actually work it would need to be public anyway. The C# source generator would make it easier (do it automatically), but it would still be possible to implement the same functionality manually in any other language. |
Dropping the priority as we don't have early AoT customers depending on it. |
A whole lot of startup going into generating EventSource manifests and Guids etc for a standardish ASP.NET Core app with ApplicationInsights, e.g. this is https://themesof.net/ Couldn't fit it all on one screen, here's the rest |
For https://themesof.net/ looks like 27 With any not in |
It is an issue for PowerShell startup too. |
Any payload that uses complex data types in All Framework |
EventSource is a common logging abstraction in .NET but it uses reflection to generate the schema for an EventSource definition. The source generator would do this at build time and make using EventSources reflection free.
The text was updated successfully, but these errors were encountered: