-
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
Initial work to port EventPipe library to NativeAOT #80382
Conversation
Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas Issue DetailsGetting EventPipe to full functionality as outlined in #79241 still has significant work remaining, but this PR is at a sweet spot between demonstrating end-to-end event data flowing from a NativeAOT application to a listening client and having too much new code to CR. The current status allows a NativeAOT application to send EventSource events to a listening client (command CollectTracing2 in https://github.com/dotnet/diagnostics/blob/main/documentation/design-docs/ipc-protocol.md) in windows. This is done by adding a new opt-in library for AOT.
The NativeAOT EventSource sample application is currently shown in reproNative and the listening client application is a .NET application similar to https://github.com/LakshanF/CSharp/blob/master/src/aot/experiments/Diagnostics/Logging/EventSource/DiagnsoticsClient/Program.cs New CodeAlthough the 'new code' in this initial PR seems large with 6000+, there is really not much new code that is getting checked in as explained below. As outlined in https://github.com/dotnet/runtime/tree/main/src/native/eventpipe#eventpipe-and-diagnosticserver, NativeAOT EventPipe library uses the common code that both Mono and CoreCLR runtime uses and provides the following features as required by the EventPipe library;
The rest of the new code is mostly as below:
|
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.
Just flushing out a couple comments I have. I'll clearly need to spend a lot more time on understanding all this.
src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Unix.targets
Outdated
Show resolved
Hide resolved
src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Unix.targets
Outdated
Show resolved
Hide resolved
src/coreclr/nativeaot/Runtime/AotDisabledEventPipeInterface.cpp
Outdated
Show resolved
Hide resolved
…e.Unix.targets Co-authored-by: Michal Strehovský <MichalStrehovsky@users.noreply.github.com>
src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Windows.targets
Outdated
Show resolved
Hide resolved
src/coreclr/tools/aot/ILCompiler/reproNative/reproNative.vcxproj
Outdated
Show resolved
Hide resolved
…e.Windows.targets Co-authored-by: Michal Strehovský <MichalStrehovsky@users.noreply.github.com>
MichalStrehovsky@99a0dd3 has the general direction of how to resolve the incompatibilities between redhawk headers (that don't want to include Windows.h) and eventpipe (that wants Windows.h). Basically, put everything that uses Redhawk headers into the .cpp file and not in the header. There's probably some minimal subset of redhawk headers that we want to include (like the atomics) so that these don't turn into function calls. But event pipe C sources should see as little of redhawk as possible. Putting redhawk headers into places that will make them included from event pipe is asking for trouble. If needed we can refactor things in the redhawk headers like I did with the move of I don't think we should defer into #81285. That issue should be fixed with this PR. It's requiring us to do unnatural things and they'll have to be backed out. |
/azp run runtime-extra-platforms |
Azure Pipelines successfully started running 1 pipeline(s). |
* Undo unnecessary changes * Make sure runtime can build without FEATURE_PERFTRACING
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.
I pushed out two commits with cleanups, please have a look.
Otherwise looks reasonable. Would be cool if someone who can tell a difference between even pipe and diagnostic pipe can have a look as well.
Getting EventPipe to full functionality as outlined in #79241 still has significant work remaining, but this PR is at a sweet spot between demonstrating end-to-end event data flowing from a NativeAOT application to a listening client and having too much new code to CR.
The current status allows a NativeAOT application to send EventSource events to a listening client (command CollectTracing2 in https://github.com/dotnet/diagnostics/blob/main/documentation/design-docs/ipc-protocol.md) in windows. This is done by adding a new opt-in library for AOT.
The NativeAOT EventSource sample application is currently shown in reproNative and the listening client application is a .NET application similar to this client application.
New Code
Although the 'new code' in this initial PR seems large with 6000+, there is really not much new code that is getting checked in as explained below. As outlined in https://github.com/dotnet/runtime/tree/main/src/native/eventpipe#eventpipe-and-diagnosticserver, NativeAOT EventPipe library uses the common code that both Mono and CoreCLR runtime uses and provides the following features as required by the EventPipe library;
The rest of the new code is mostly as below: