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

Fix PGO trace data collection in the presence of collectible assemblies #68001

Merged
merged 4 commits into from
Apr 15, 2022

Conversation

davidwrighton
Copy link
Member

@davidwrighton davidwrighton commented Apr 14, 2022

We didn't handle unknown type handles in the data. Currently this can only happen for collectible assemblies.

Fixes #67877

@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label.

Copy link
Member

@jakobbotsch jakobbotsch left a comment

Choose a reason for hiding this comment

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

Doesn't this mean we will overestimate the likelihood of non-dynamic classes when static PGO is used? There are comments indicating this is the intention of unknown type handles in the probe helpers:

// If the object class is collectible, record an unknown typehandle.
// We do this instead of recording NULL so that we won't over-estimate
// the likelihood of known type handles.
//
if (pMT->GetLoaderAllocator()->IsCollectible())
{
pMT = (MethodTable*)DEFAULT_UNKNOWN_TYPEHANDLE;
}

@jakobbotsch
Copy link
Member

Ah, I realize this is only used to figure out which types we need to emit type detail ETW events for, so disregard the above comment.

@davidwrighton davidwrighton merged commit 248b8c0 into dotnet:main Apr 15, 2022
@ghost ghost locked as resolved and limited conversation to collaborators May 15, 2022
@davidwrighton davidwrighton deleted the fix_pgo_bug_67877 branch April 13, 2023 18:51
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.

Custom apphost fails to flush nettrace file on shutdown
2 participants