Skip to content
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

DCStart events from EventPipe #42378

Open
valco1994 opened this issue Sep 17, 2020 · 3 comments
Open

DCStart events from EventPipe #42378

valco1994 opened this issue Sep 17, 2020 · 3 comments

Comments

@valco1994
Copy link
Contributor

As far as I see, currently, EventPipe only sends events from Microsoft-Windows-DotNETRuntimeRundown at the end of the session. So, I can receive *DCEnd* events with EventPipe, but can't receive *DCStart* events, which are supposed to be sent when the session started.

It means, that I can't resolve stacks in real-time with EventPipe, while with ETW I can choose to resolve it in real-time or during post-processing.

Could you clarify, if it is a bug or it is supposed to be so by design and isn't going to be changed?
It would be very nice to have *DCStart* events with EventPipe.

@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added area-Tracing-coreclr untriaged New issue has not been triaged by the area owner labels Sep 17, 2020
@tommcdon tommcdon removed the untriaged New issue has not been triaged by the area owner label Sep 17, 2020
@tommcdon tommcdon added this to the 6.0.0 milestone Sep 17, 2020
@tommcdon tommcdon added the question Answer questions and provide assistance, not an issue with source code or documentation. label Sep 17, 2020
@tommcdon tommcdon added this to Needs Triage in .NET Core Diagnostics via automation Sep 17, 2020
@tommcdon
Copy link
Member

@sywhang @josalem

@josalem
Copy link
Contributor

josalem commented Sep 17, 2020

One workaround is to start an EventPipe session with rundown enabled, then immediately end it to collect the rundown events at any point in time.


Looking at the code, we only invoke ETW::EnumerationLog::EndRundown in EventPipe (when a session ends). I don't see any calls to ETW::EnumerationLog::StartRuntdown so, this is currently by design, whether intentional or not. This is, however, something we can change, but most likely not for 5.0.

I think we could move/translate this chunk of code:

if(g_fEEStarted && !g_fEEShutDown && bIsRundownTraceHandle)
{
// Start and End Method/Module Rundowns
// Used to fire events that we missed since we started the controller after the process started
// flags for immediate start rundown
if(ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_RUNDOWN_PROVIDER_DOTNET_Context,
TRACE_LEVEL_INFORMATION,
CLR_RUNDOWNSTART_KEYWORD))
ETW::EnumerationLog::StartRundown();
// flags delayed end rundown
if(ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_RUNDOWN_PROVIDER_DOTNET_Context,
TRACE_LEVEL_INFORMATION,
CLR_RUNDOWNEND_KEYWORD))
ETW::EnumerationLog::EndRundown();
}
if (g_fEEStarted && !g_fEEShutDown && (ControlCode == EVENT_CONTROL_CODE_CAPTURE_STATE))
{
ETW::EnumerationLog::EnumerateForCaptureState();
}
}

up a level, to here
VOID EtwCallbackCommon(
.

Better yet, we could do a larger audit of these two functions to validate we aren't artificially preventing some functionality of EventPipe. For now, this on our potential 6.0 backlog.

@valco1994
Copy link
Contributor Author

Thank you for the clarification, @josalem.
I think this issue can be reclassified as a "Feature request" so.

@tommcdon tommcdon added feature-request and removed question Answer questions and provide assistance, not an issue with source code or documentation. labels Sep 18, 2020
@tommcdon tommcdon modified the milestones: 6.0.0, 7.0.0 Jun 16, 2021
@tommcdon tommcdon modified the milestones: 7.0.0, Future May 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants