dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
15.05k stars 4.69k forks source link

Support EventSource/event pipe in shared libraries #91762

Open MichalStrehovsky opened 1 year ago

MichalStrehovsky commented 1 year ago

When EventSourceSupport MSBuild property is set to true, the build currently errors out. It is possible to bypass this by setting _SuppressNativeLibEventSourceError property to true but there are known issues. It is not recommended to ship native libraries like this unless one can make sure no other native library (or a CoreCLR instance) with EventSourceSupport gets loaded into the process. Users might consider shipping two versions of their native library DLL and only use the one with EventSourceSupport enabled when troubleshooting a specific issue.

This is a tracking uber issue that groups the known existing problems:

Our guidance for EventSource/EventPipe with native AOT shared libraries is as follows,

Given these challenges, it's probably best to keep the current warnings we have for shared library around EventSource support.

ghost commented 1 year ago

Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas See info in area-owners.md if you want to be subscribed.

Issue Details
When `EventSourceSupport` MSBuild property is set to true, the build currently errors out. It is possible to bypass this by setting `_SuppressNativeLibEventSourceError` property to true but there are known issues. It is not recommended to ship native libraries like this unless one can make sure no other native library (or a CoreCLR instance) with EventSourceSupport gets loaded into the process. Users might consider shipping two versions of their native library DLL and only use the one with EventSourceSupport enabled when troubleshooting a specific issue. This is a tracking uber issue that groups the known existing problems: - [ ] https://github.com/dotnet/runtime/issues/88087 - [ ] (Windows only) https://github.com/dotnet/runtime/issues/89346
Author: MichalStrehovsky
Assignees: -
Labels: `area-NativeAOT-coreclr`
Milestone: Future