-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
gh-109371: Fix monitoring with instruction events set #109385
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
gh-109371: Fix monitoring with instruction events set #109385
Conversation
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.
LGTM with my little knowlege.
Thanks @gaogaotiantian for the PR, and @corona10 for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12. |
…-109385) (cherry picked from commit 412f5e8) Co-authored-by: Tian Gao <[email protected]>
GH-109542 is a backport of this pull request to the 3.12 branch. |
|
Two things were fixed:
initialize_tools
, we need to deoptINSTRUMENTED_INSTRUCTION
to get the opcode to check for event. Unfortunately as whether the current opcode is instrumented is needed in the context later, we can't do_Py_GetBaseOpcode
here to reduce the seemingly redundant logic.instrument
, assertion that after deinstrumentingINSTRUMENTED_LINE
andINSTRUMENTED_INSTRUCTION
, the opcode would be NOT instrumented is invalid - it could still be instrumented for events likePY_RETURN
.Test cases were added for both scenarios.