-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Tiered jitting: Implement additional profiler APIs #8474
Comments
@mjsabby @SergeyKanzhelev @discostu105 - Figured you guys might have particular interest in these. Let me know if you think the APIs I suggested above sound reasonable. Also please point out if you think there are any gaps that need addressing. For example, do we need a new API that maps code pointer in method -> code start address? As-is if you wanted to do that transformation you would need to do a multi-step process like this: |
ICorProfilerFunctionControl::SetILInstrumentedCodeMap will work, but it is orthogonal to the APIs above. The APIs above would be used in scenarios where you previously used GetILToNativeMapping1/2 and GetCodeCodeInfo1/2/3. For example in the past to map a native offset to an IL offset, may have called:
That flow breaks down as soon as you can have more than one jitted method body for the same FunctionID (and same rejitid). You need a stronger identifier to indicate which jitted method body you are trying to refer to, because each jitted method body may have a different native->IL map and definately will have different memory bounds. |
Just to confirm - when you call to Is it fair to say you only need proposed API when you change method body drastically? By drastically I mean not making an additive code modification like inserting prefix, postfix or something in the middle. You need new API when you inserting new code that should be debuggable and need it's own mapping to Native Code. |
Nope : ) It sounds like you are analyzing this from the perspective of using ReJIT in the profiler, but ignore that part for the moment. Imagine that you have a simple profiler that never uses ReJIT or any form of IL instrumentation. The changes to the method body aren't coming from your profiler, they are coming from the runtime when it jits a method again using different jit optimization flags. If that hypothetical simple profiler was using GetILToNativeMapping or GetCodeInfo before, it probably needs to be using the new APIs now. Does your profiler use GetILToNativeMapping or GetCodeInfo today? |
no. Sorry |
Nothing to be sorry about - thats good, it means you probably don't need to worry about these changes. |
@noahfalk I think we're good on this, we do use the APIs you mentioned and I'll update it. Conceptually things should work for our profilers but have to make code changes. |
@davmason: this should be complete, but for the tests... ? |
Tiered jitting breaks a previous invariant that there would only be one jitted code body per <FunctionID, ReJitID, generic instantiation> tuple. In order to address this we need to add some new APIs that profilers can use to get information about these new method bodies. The breaking change doc added in dotnet/coreclr#12193 has a bit more background. The likely APIs (design not final) would be:
There may also be a tiered compilation opt-out mechanism added to the profiler API, but any work for that is tracked under #8473.
The text was updated successfully, but these errors were encountered: