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

Support profile instrumentation for inlinees #44372

Open
AndyAyersMS opened this issue Nov 6, 2020 · 2 comments
Open

Support profile instrumentation for inlinees #44372

AndyAyersMS opened this issue Nov 6, 2020 · 2 comments
Assignees
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Milestone

Comments

@AndyAyersMS
Copy link
Member

AndyAyersMS commented Nov 6, 2020

The jit and runtime currently do not support instrumenting (BBINSTR) of inlined code. Enabling this may prove useful for a number of reasons -- for example we are currently not be able to observe the behavior of methods marked with aggressive inline attributes.

(This doesn't impact dynamic PGO as it instruments Tier0 code where inlining is disabled).

Outline of how to fix this:

  • update the jit interface so we can pass a method handle to allocMethodBlockCounts (or introduce a new method)
  • update jit interface implementation so that if a method already has a count buffer allocated, it is returned. We will need some way to map from method to profile data.
  • update the jit to pass the BBINSTR flag to inlinees, if the root method has it set.
  • verify the jit does reasonable things in inlinees when the BBINSTR flag is set.

We could consider keeping inlinee counts separate from root method counts to avoid perturbing current IBC computations (collating all counts in one buffer will change which methods are considered hot by IBC). If we do this then count request and retrieval also need to be updated so the jit can indicate if it wants the counts for a root method or the counts for an inlinee. However this may make it hard to persist out the inlinee data as tooling is not expecting two sets of counts for methods.

At the same time we might want to suppress instrumentation for single-block inlinees to reduce the volume and runtime cost of counts.

So initially inlinee counts should be optional behavior until we can assess impact on IBC.

category:cq
theme:inlining

@Dotnet-GitSync-Bot
Copy link
Collaborator

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

@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added the untriaged New issue has not been triaged by the area owner label Nov 6, 2020
@AndyAyersMS AndyAyersMS added area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI and removed untriaged New issue has not been triaged by the area owner labels Nov 6, 2020
@AndyAyersMS AndyAyersMS added this to the 6.0.0 milestone Nov 6, 2020
@AndyAyersMS AndyAyersMS self-assigned this Nov 6, 2020
@AndyAyersMS
Copy link
Member Author

Not clear we'll need this anytime soon, so will move to future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Projects
Status: Team User Stories
Development

No branches or pull requests

2 participants