-
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
Setup support for managed runtime events #87785
Conversation
Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas Issue DetailsInitial work to enable managed runtime events in
|
Is the plan to also fire these via ETW (on Windows)?
I'd expect only the events that go through |
I can see events GCGlobalHeapHistory and GCHeapStats getting fired in Linux. Opened #88162 for adding these events to ETW. |
src/coreclr/nativeaot/System.Private.CoreLib/src/System/Runtime/RuntimeImports.cs
Outdated
Show resolved
Hide resolved
src/coreclr/nativeaot/System.Private.CoreLib/src/System/Runtime/RuntimeImports.cs
Outdated
Show resolved
Hide resolved
src/tests/tracing/eventpipe/simpleprovidervalidation/simpleprovidervalidation.cs
Outdated
Show resolved
Hide resolved
src/tests/tracing/eventpipe/simpleprovidervalidation/simpleprovidervalidation.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: Elinor Fung <elfung@microsoft.com>
src/coreclr/nativeaot/System.Private.CoreLib/src/System/Runtime/RuntimeImports.cs
Outdated
Show resolved
Hide resolved
.../src/System/Diagnostics/Eventing/NativeRuntimeEventSource.Threading.NativeSinks.NativeAot.cs
Show resolved
Hide resolved
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'm assuming the dotnetruntime.cpp
functions added for writing the events is lifted from the auto-generated ones for coreclr, so I didn't look at them much.
cc @davmason - if you are interested in the tracing/eventpipe test changes
|
||
#ifdef FEATURE_PERFTRACING | ||
|
||
// We will do a no-op for events in the disabled EventPipe This is similar to the way eventpipe checks if the provider and an event is enabled before firting the event, and no-op otherwise. |
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.
Can we not make the managed side conditionally call the runtime import based on event source support and let trimming do its thing? Or are we trying to keep the event source feature switch and disabled/enabled eventing native library independent from one another?
Just thinking that the disabled and enabled definitions might be getting a bit unwieldy and we could presumably remove the disabled ones only called from managed (maybe also a really small size decrease).
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 updated the issue #82231 with this as well.
.../src/System/Diagnostics/Eventing/NativeRuntimeEventSource.Threading.NativeSinks.NativeAot.cs
Show resolved
Hide resolved
src/tests/tracing/eventpipe/simpleruntimeeventvalidation/simpleruntimeeventvalidation.cs
Outdated
Show resolved
Hide resolved
src/tests/tracing/eventpipe/simpleruntimeeventvalidation/simpleruntimeeventvalidation.cs
Outdated
Show resolved
Hide resolved
src/tests/tracing/eventpipe/providervalidation/providervalidation.cs
Outdated
Show resolved
Hide resolved
{ | ||
{ "MyEventSource", new ExpectedEventCount(100_000, 0.30f) }, | ||
{ "Microsoft-Windows-DotNETRuntimeRundown", -1 }, | ||
{ "Microsoft-DotNETCore-SampleProfiler", -1 } | ||
}; | ||
|
||
private static Dictionary<string, ExpectedEventCount> _expectedEventCountsNativeAOT = new Dictionary<string, ExpectedEventCount>() | ||
{ | ||
{ "MyEventSource", 100_000 }, |
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.
Does coreclr need the ExpectedEventCount
error, but nativeaot does not?
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 believe coreclr
error range tolerance is an artifact of earlier times when EventPipe
was dropping events. NativeAOT doesn't support rundown and sampleprofiler
and followed a policy of not touching coreclr
testing.
`tracing/eventpipe/simpleruntimeeventvalidation`: ``` Generated app bundle at /root/helix/work/workitem/e/tracing/eventpipe/simpleruntimeeventvalidation/simpleruntimeeventvalidation/WasmApp/ Incoming arguments: --run simpleruntimeeventvalidation.dll Application arguments: --run simpleruntimeeventvalidation.dll console.info: Initializing dotnet version 8.0.0-ci commit hash f47b553f129cfa7f006cb1a2f2088112c5ca0112 0.0s: ==TEST STARTING== 0.1s: System.PlatformNotSupportedException: System.Diagnostics.Process is not supported on this platform. at System.Diagnostics.Process.GetCurrentProcess() at Tracing.Tests.Common.IpcTraceTest.Validate(Boolean enableRundownProvider) at Tracing.Tests.Common.IpcTraceTest.RunAndValidateEventCounts(Dictionary`2 expectedEventCounts, Action eventGeneratingAction, List`1 providers, Int32 circularBufferMB, Func`2 optionalTraceValidator, Boolean enableRundownProvider) 0.1s: ==TEST FINISHED: FAILED!== test-main.js exiting simpleruntimeeventvalidation.dll with result -1 console.info: WASM EXIT -1 ``` This was added in dotnet#87785, but got merged on red.
`tracing/eventpipe/simpleruntimeeventvalidation`: ``` Generated app bundle at /root/helix/work/workitem/e/tracing/eventpipe/simpleruntimeeventvalidation/simpleruntimeeventvalidation/WasmApp/ Incoming arguments: --run simpleruntimeeventvalidation.dll Application arguments: --run simpleruntimeeventvalidation.dll console.info: Initializing dotnet version 8.0.0-ci commit hash f47b553f129cfa7f006cb1a2f2088112c5ca0112 0.0s: ==TEST STARTING== 0.1s: System.PlatformNotSupportedException: System.Diagnostics.Process is not supported on this platform. at System.Diagnostics.Process.GetCurrentProcess() at Tracing.Tests.Common.IpcTraceTest.Validate(Boolean enableRundownProvider) at Tracing.Tests.Common.IpcTraceTest.RunAndValidateEventCounts(Dictionary`2 expectedEventCounts, Action eventGeneratingAction, List`1 providers, Int32 circularBufferMB, Func`2 optionalTraceValidator, Boolean enableRundownProvider) 0.1s: ==TEST FINISHED: FAILED!== test-main.js exiting simpleruntimeeventvalidation.dll with result -1 console.info: WASM EXIT -1 ``` This was added in #87785, but got merged on red.
Initial work to enable managed runtime events in
EventPipe
. The work includesthreadpool
events inEventPipe
and aligns to the merged PR related to Contention, Add managed entry points for raising Contention events #87087. However, additional work needs to be done to have all the relevant events fired. PR Expose aLock
type in preview mode #87672, and issue Enable relevant thread pool events in Windows #87020 need to be completed to get a larger set of events hooked.FireEtwExceptionThrown_V1
) to be fired byEventPipe
. Issue DotnetRuntime provider needs to handle WCHAR strings #87978 tracks to handleWCHAR
strings inEventPipe
EventPipe
. Issue .net8 prev 5 unassociated AOT processes crash when the debugger starts on the system. #87739 runs into NYIRhEventPipeInternal_WaitForSessionSigna
l, and hopefully should be unblocked with these changes.NativeAOT