Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
gh-106597: Add debugging struct with offsets for out-of-process tools#106598
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Uh oh!
There was an error while loading.Please reload this page.
pablogsal commentedJul 10, 2023
@markshannon Can you take another look? |
markshannon commentedJul 10, 2023
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. |
pablogsal commentedJul 10, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
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. |
carljm commentedJul 10, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
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. |
carljm commentedJul 10, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
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 |
pablogsal commentedJul 10, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
I will add these to this PR 👍 |
pablogsal commentedJul 10, 2023
Good point! Will update the PR tomorrow to include that comment. |
Uh oh!
There was an error while loading.Please reload this page.
godlygeek commentedJul 11, 2023
PyStack needs a few more fields than we have here. We also need:
|
pablogsal commentedJul 11, 2023
I added all the offsets you mentioned for Strobelight except |
Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
pablogsal commentedJul 11, 2023
@carljm I added the fields you mentioned and modified the comment. Could you please take a look? |
carljm left a comment
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
Uh oh!
There was an error while loading.Please reload this page.