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

Initialize RuntimeEventSource as part of coreclr_initialize instead of only when running an app #105902

Merged
merged 2 commits into from
Aug 5, 2024

Conversation

elinor-fung
Copy link
Member

@elinor-fung elinor-fung commented Aug 2, 2024

Fixes #83935

We were only initializing RuntimeEventSource before running an application. This meant that native hosting scenarios - COM, C++/CLI, custom - would never initialize it. As a result, diagnostic tracing tools - like dotnet-counters - did not work properly.

This moves the call to RuntimeEventSource.Initialize out of StartupHookProvider.ManagedStartup and to be part of coreclr_initialize.

Manually validated with dotnet-counters targeting native host and native client for C++/CLI or COM.

cc @dotnet/appmodel

@elinor-fung elinor-fung changed the title Initialize RuntimeEventSource as part of coreclr_initialize instead of running an app Initialize RuntimeEventSource as part of coreclr_initialize instead of only when running an app Aug 3, 2024
@elinor-fung elinor-fung requested a review from a team August 3, 2024 01:39
@jkotas
Copy link
Member

jkotas commented Aug 3, 2024

// In CoreCLR, this is done via StartupHookProvider.CoreCLR.cs
should be updated too

Copy link
Member

@noahfalk noahfalk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Also a heads up that the change for #105845 is going to touch some of the same code. You should merge first and I'll rebase around your changes.

@elinor-fung elinor-fung merged commit 815650e into dotnet:main Aug 5, 2024
149 checks passed
@elinor-fung elinor-fung deleted the fix83935 branch August 5, 2024 19:24
@github-actions github-actions bot locked and limited conversation to collaborators Sep 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

dotnet-counters stuck at "Waiting for initial payload..." for hostfxr-hosted application
3 participants