gh-151436: Fix missing tstate->last_profiled_frame updates#151437
Conversation
Yes, this should be a macro.
Yeah I think is still possible to have this sequence of events:
we can try to think how to tackle this in a separate issue, there are some mitigations we can do |
|
I have pushed 1348756 making this a macro |
|
Thanks @maurycy for the PR, and @pablogsal for merging it 🌮🎉.. I'm working now to backport this PR to: 3.15. |
|
GH-151612 is a backport of this pull request to the 3.15 branch. |
|
|
Did you measure the performance impact of this? The profiler is specified as being zero overhead, but this clearly adds overhead to every |
Yes I measure and performance is neutral. You can measure yourself if you want to double check of course. Same as #142137 (comment)
No, it only does something when the value of the last profile frame is 0 (which is only true when profiling) otherwise is a perfectly predictable branch |
Please see #151436 for more details.
The issue is fixed,
drv_ais back:0,5% (48/9996 = 0,48%) is roughly correct, since it shouldn't be exactly linear.
I can try to come up with reproduction for each miss.
Should it be a helper?
If you ask me, the whole mechanism smells me of ABA...
_remote_debugging: Missinglast_profiled_frameupdates in coroutines, generators, etc. #151436