-
Notifications
You must be signed in to change notification settings - Fork 5.1k
[DRAFT] Use il offset walker instead of debugger data to gather the IL offset during stack trace generation #116031
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
base: main
Are you sure you want to change the base?
[DRAFT] Use il offset walker instead of debugger data to gather the IL offset during stack trace generation #116031
Conversation
- This removes it from normal path - This also adds an assert that it is correct Logically, this code should probably replace the current implementation of GetILOffsetFromNative but this first pass is just to get the code working This is untested, but it does compile.
Tagging subscribers to this area: @tommcdon |
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.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
… chunks and doing very cheap operations per nibble read - Add a fixed size cache around the native to IL mapping operations in the stacktrace logic - Unfortunately, simply reading the nibble data is pretty slow, so this is needed to avoid regressing performance - With this change the performance of newing up a StackTrace object on a multithreaded environment is primarily driven by GC allocation rate, and not significantly by any other locks.
This both generates less data (Experiments show about a 70KB reduction in size of System.Private.CoreLib.dll R2R image) And the reader as implemented here, is quite a bit faster When combined with the cache constructed in a different part of this PR, this results in the cost of IL offset determination for a given IP to have negligible cost.
@@ -13215,6 +13216,9 @@ static TADDR UnsafeJitFunctionWorker( | |||
if (g_pDebugInterface) | |||
{ | |||
g_pDebugInterface->JITComplete(nativeCodeVersion, (TADDR)nativeEntry); | |||
#ifdef DEBUG | |||
ValidateILOffsets(ftn, NULL, 0, (uint8_t*)nativeEntry, sizeOfCode); |
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.
This offset validation is causing some tests to time out. Build analysis may be misclassifying some of these timeouts against unrelated known issues (e.g. #116748)
Add a path for reading the IL-Native map which doesn't create a DebuggerFunctionInfo or DebuggerJitInfo
Use it in the stackwalker code for EH.
Draft because: