-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Send tiered compilation settings rundown event on EventPipe detach #24993
Conversation
Many other rundown events are missing even after enabling the provider, such as importantly |
Ideally this code should be somewhere under the call-tree starting with ETW::EnumerationLog::EndRundown() and you would get there at this callstack: ETW::EnumerationLog::EndRundown() Putting it under EndRundown() has a few advantages: If there is something blocking us from doing the long term solution I'm open to short term workarounds, but then I'd request there is some work item that tracks what needs to be fixed (repro scenario, any bug investigation notes) in order to move from the short-term to the long-term. |
How do you know If we identify something is missing from the trace, we should file an issue to track the missing of them. |
There has to be some event associating a jitted code address with a method name. If I attach to a process after all jitting is finished, I don't see any stacks shown. When I last checked with ETL profiles, for native-to-IL-to-source mapping (to show samples by source line) the native-to-IL map event needed to be paired with the DCStopVerbose. There may be other events, though I don't know much more. In my high level view ideally a rundown would be done upon attach (StartRundown) to collect info about loaded modules and jitted methods at the time of attach, and then a rundown on detach shouldn't be necessary because we would get live events from jitting and module load/unload from that point onwards. I believe PerfView by default when collecting ETL traces only does a rundown on detach (EndRundown), I'm not sure if that would work for dynamic or collectible methods, where the method was loaded before attach and gets unloaded after attach and before detach, as the rundown on detach would not provide info about that method. |
Thanks, I had it there initially except I had put it in the |
- Moved the `RuntimeInformation` and `TieredCompilation/Settings` events to fire on rundown on attach/detach
1f7aee5
to
4f7b31e
Compare
I wasn't involved in the initial decision making so I don't know if this is accurate, but I assume one of the considerations is how much initiating the trace session will perturb the process. Rundown can be quite expensive so if you imagine attaching to process that is currently reproing a delicate issue or needs to remain responsive in production then stalling to write a 10K rundown events might not work well. I expect these concerns are pretty scenario specific and you could easily imagine deciding that for certain small sets of events it was better to emit them early, but for other more voluminous events you would defer them. |
Yea I figured that might be a reason, would be nice to have an option to enumerate on start though, I haven't tried but I don't think it would work currently. |
I had issues with the case where the process exits while tracing is happening too, where I don't think a rundown happens currently. |
I'm not sure if we'd get to it priority-wise as 3.0 is just about done, but from a technical standpoint I agree it would be a nice option for us to have available. If you want to open an issue it feels like something we should look into. |
We do seem to get Method/UnloadVerbose when the process exits, so that should be enough but still not getting the stacks I expect to see (in ETL traces). |
I'll look into opening an issue, it would be useful for tracing shutdown scenarios, or if taking a long trace and unexpectedly the process exits. I agree it's not that important right now. |
Does the change look ok? |
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.
LGTM. Thanks Kount!
@@ -431,9 +431,6 @@ void EventPipe::DisableInternal(EventPipeSessionID id, EventPipeProviderCallback | |||
// Log the process information event. | |||
LogProcessInformationEvent(*s_pEventSource); | |||
|
|||
// Log the runtime information event. | |||
ETW::InfoLog::RuntimeInformation(ETW::InfoLog::InfoStructs::Normal); |
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.
Thanks for cleaning this one up too : )
cc @dotnet/dotnet-diag |
As far as I'm aware, |
I've only seen EndRundown being called currently. Once StartRundown becomes possible, I imagine only one type of rundown would be done, or there may be a different kind of partial rundown on end that may take a different path or have a parameter to specify partial. |
- Moved the `RuntimeInformation` and `TieredCompilation/Settings` events to fire on rundown on attach/detach Commit migrated from dotnet/coreclr@3c1997d
No description provided.