-
-
Notifications
You must be signed in to change notification settings - Fork 30.4k
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-106597: Add debugging struct with offsets for out-of-process tools #106598
Conversation
pablogsal
commented
Jul 10, 2023
•
edited by bedevere-bot
Loading
edited by bedevere-bot
- Issue: Add a collection of offsets to facilitate the work of out-of-process debuggers #106597
@markshannon Can you take another look? |
I actually meant using pointers, so that the fields don't move. But this is fine. I'm not the one using this. If it suits pystack, pyspy and austin, them I'm cool with whatever you want. |
Ah, that would make retrieving these a bit more annoying because it would imply having to copy an extra pointer per structure group and also it makes initializing the runtime state more verbose so I would prefer to leave it as is. |
What are the backward-compat guarantees for this struct? Should we document them? I assume for this to be useful we should only ever add anything to the end of this struct, so that profilers don't have to have per-Python-version maps of the struct in order to be able to use the values in it correctly? (Also should we commit explicitly that this struct will always occur first in PyRuntimeState?) And does that mean we commit to the future existence of all the struct fields with offsets listed here? Or if the struct field would be removed in a future Python, we'd set the offset to some kind of sentinel value without removing the entry from the debug-offsets struct? EDIT: ok, I see now in the issue that there is no backwards-compatibility guarantee at all between minor versions. That also seems worth documenting, at least in a comment? There is already a comment saying the debug struct should stay first. |
FWIW, here's a list of offsets that we currently export from Cinder for use by our in-house out-of-process profiler (Strobelight), that are not currently exported in this PR:
Also, if we give an offset for And if we expose an offset for |
I will add these to this PR 👍 |
Good point! Will update the PR tomorrow to include that comment. |
PyStack needs a few more fields than we have here. We also need:
|
I added all the offsets you mentioned for Strobelight except |
Signed-off-by: Pablo Galindo <[email protected]>
@carljm I added the fields you mentioned and modified the comment. Could you please take a look? |
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.
Looks great! Thank you @pablogsal