Emit JITStarting, MethodLoad, ModuleLoad and AssemblyLoad EventPipe events on Mono. #53020
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add support to emit JITStarting, MethodLoad, ModuleLoad and AssemblyLoad EventPipe events on Mono.
The JITStarting and MethodLoad is hooked up to existing profiler events jit_begin, jit_done meaning that it will cover JIT as well as loading of AOT methods or transformation of interpreter methods.
The module/assembly load events are hooked up to existing profiler events, image_loaded and assembly_loaded.
Profiler callbacks are dynamically added/removed based on EventPipe provider enable/disable callbacks, meaning that when no eventpipe session is using the runtime provider, all callbacks registered by that provider will be removed from mono profiler and runtime won't take any additional cost once a session (using the runtime provider) has been disabled.
These additional events gives some extra data in prefview making it possible to view JIT stats:
It also adds the JittingStarted metrics into the "Any Stack" view giving some more data points per callstacks:
These new events can also be consumed directly from the nettrace stream, making it possible to do custom presentations of JIT statistics combined with callstack information.