Repository navigation
Prevent TieredPGO inlining from breaking stack trace walking logic - #2620
Conversation
| namespaceName.StartsWith("Microsoft.Playwright.Helpers", StringComparison.InvariantCultureIgnoreCase)); | ||
| } | ||
|
|
||
| [MethodImpl(MethodImplOptions.NoInlining)] // This method is also a stacktrace marker. |
There was a problem hiding this comment.
While not strictly necessary, it seems a good idea to make this explicit
|
Unfortunately I've done some further testing and it looks like a lot of the method names captured in the trace will change to base types, which isn't desired, I'll look to improve this PR. |
|
Update: So this PR fixes the playwright-dotnet/src/Playwright.Tests/TracingTests.cs Lines 69 to 75 in ca7b02a we're going to need to sprinkle NoInlining over all of the public APIs. I've been thinking about other approaches that don't do stack frame walking, however some public APIs flow through other public APIs , for example Page.GotoAsync → Frame.GotoAsync (see here), which makes that harder to do in a non-breaking way.
|
|
So this is now working and tested with some traces. Unfortunately the cleanest way I could think to do this was add |
Max Schmitt (mxschmitt)
left a comment
There was a problem hiding this comment.
Amazing work!
| { | ||
| if (!method.MethodImplementationFlags.HasFlag(MethodImplAttributes.NoInlining)) | ||
| { | ||
| #pragma warning disable CA1305 |
There was a problem hiding this comment.
would be nice to get rid of that.
|
Stuart Lang (@slang25) thank you so much for looking into this and Andy Ayers (@AndyAyersMS) for filing it inside this repo with all the details! |
|
My pleasure Max Schmitt (@mxschmitt) 🙂 |
Fixes #2617
I've recreated the issue locally on macOS on my M2 MBP, this fixes the exception, I need to check that the traces have the right API names captured still.