-
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
[cdac] Handle hot/cold map lookup in ExecutionManager.ReadyToRunJitManager.GetMethodInfo
#110087
Merged
elinor-fung
merged 13 commits into
dotnet:main
from
elinor-fung:cdac-methodDescData-r2r-hotcold
Nov 26, 2024
Merged
[cdac] Handle hot/cold map lookup in ExecutionManager.ReadyToRunJitManager.GetMethodInfo
#110087
elinor-fung
merged 13 commits into
dotnet:main
from
elinor-fung:cdac-methodDescData-r2r-hotcold
Nov 26, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
elinor-fung
requested review from
davidwrighton,
AaronRobinsonMSFT and
max-charlamb
November 22, 2024 16:43
dotnet-issue-labeler
bot
added
the
needs-area-label
An area label is needed to ensure this gets routed to the appropriate area owners
label
Nov 22, 2024
elinor-fung
added
area-Diagnostics-coreclr
and removed
needs-area-label
An area label is needed to ensure this gets routed to the appropriate area owners
labels
Nov 22, 2024
11 tasks
Tagging subscribers to this area: @tommcdon |
...ractReader.Contracts/Contracts/ExecutionManager/ExecutionManagerBase.ReadyToRunJitManager.cs
Show resolved
Hide resolved
...ractReader.Contracts/Contracts/ExecutionManager/ExecutionManagerBase.ReadyToRunJitManager.cs
Show resolved
Hide resolved
...Diagnostics.DataContractReader.Contracts/Contracts/ExecutionManager/Helpers/HotColdLookup.cs
Show resolved
Hide resolved
...Diagnostics.DataContractReader.Contracts/Contracts/ExecutionManager/Helpers/HotColdLookup.cs
Show resolved
Hide resolved
...Diagnostics.DataContractReader.Contracts/Contracts/ExecutionManager/Helpers/HotColdLookup.cs
Show resolved
Hide resolved
...Diagnostics.DataContractReader.Contracts/Contracts/ExecutionManager/Helpers/HotColdLookup.cs
Outdated
Show resolved
Hide resolved
...ics.DataContractReader.Contracts/Contracts/ExecutionManager/Helpers/RuntimeFunctionLookup.cs
Outdated
Show resolved
Hide resolved
...managed/cdacreader/Microsoft.Diagnostics.DataContractReader.Contracts/Data/ReadyToRunInfo.cs
Show resolved
Hide resolved
elinor-fung
commented
Nov 22, 2024
|
||
namespace Microsoft.Diagnostics.DataContractReader.ExecutionManagerHelpers; | ||
|
||
internal static class BinaryThenLinearSearch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If anyone has a better name...
AaronRobinsonMSFT
approved these changes
Nov 23, 2024
/ba-g failures are #110127 |
mikelle-rogers
pushed a commit
to mikelle-rogers/runtime
that referenced
this pull request
Dec 10, 2024
…anager.GetMethodInfo` (dotnet#110087) Implement the hot/cold lookup logic for `ExecutionManager.ReadyToRunJitManager.GetMethodInfo`. Basic logic is now: 1. Check if the address is in a thunk for READYTORUN_HELPER_DelayLoad_MethodCall 2. Find the runtime function entry corresponding to the address - If the runtime function entry is cold code, find the runtime function entry for the corresponding hot part 3. Look up the MethodDesc for the entry point using the ReadyToRunInfo's hash map 4. Compute the relative offset based the function's start address - If the runtime function has a cold part and the address is in the cold part, compute the relative offset based on the size of the hot part and the offset from the start of the cold part Sub-bullets of 2 and 4 are the parts added by this change. Add tests for `ExecutionManager` for getting code blocks and method desc in R2R with hot/cold splitting, runtime functions lookup functionality, and hot/cold map lookup logic. - Pull out helper for RuntimeFunctions mock memory - `ExecutionManagerTests` just uses one specific runtime function / unwind info layout - The `RuntimeFunctionsTests` handle testing the matrix of different layouts The `RuntimeFunction` and `UnwindInfo` structures are different depending on the platform. This matters for calculating the function length. To facilitate testing, I pulled out the runtime functions lookup into a helper class. This change puts reading the hot/cold map in a helper class `HotColdLookup`. Having separate helpers (similarly, HashMapLookup and NibbleMap) should let us mock them out for testing if we want - there'd still be some work for how they are created (for example, tests need to be able to provide some instance instead of the contract directly creating the class), but it puts us in a reasonable position. Manually validated with `!ip2md` (temporarily commented out throwing not implemented for rejit ID requests) for an app published with R2R `--hot-cold-splitting` that we correctly map addresses in cold/hot blocks to hot/cold parts, determine their start addresses and sizes, and return the correct method desc.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Implement the hot/cold lookup logic for
ExecutionManager.ReadyToRunJitManager.GetMethodInfo
. Basic logic is now:Sub-bullets of 2 and 4 are the parts added by this change.
Add tests for
ExecutionManager
for getting code blocks and method desc in R2R with hot/cold splitting, runtime functions lookup functionality, and hot/cold map lookup logic.ExecutionManagerTests
just uses one specific runtime function / unwind info layoutRuntimeFunctionsTests
handle testing the matrix of different layoutsThe
RuntimeFunction
andUnwindInfo
structures are different depending on the platform. This matters for calculating the function length. To facilitate testing, I pulled out the runtime functions lookup into a helper class. This change puts reading the hot/cold map in a helper classHotColdLookup
. Having separate helpers (similarly, HashMapLookup and NibbleMap) should let us mock them out for testing if we want - there'd still be some work for how they are created (for example, tests need to be able to provide some instance instead of the contract directly creating the class), but it puts us in a reasonable position.Manually validated with
!ip2md
(temporarily commented out throwing not implemented for rejit ID requests) for an app published with R2R--hot-cold-splitting
that we correctly map addresses in cold/hot blocks to hot/cold parts, determine their start addresses and sizes, and return the correct method desc.Contributes to #99302, #109426