-
Notifications
You must be signed in to change notification settings - Fork 432
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
Include libpython symbols in profile info #437
Comments
Which pythons symbols are you interested in? We already include symbols from a bunch of builtin python modules py-spy/src/native_stack_trace.rs Lines 161 to 173 in 25db5bc
py-spy/tests/scripts/longsleep.py Lines 1 to 9 in 25db5bc
vmprof doesn't handle callbacks afaik https://vmprof.readthedocs.io/en/latest/native.html#technical-design - after it detects a python frame it doesn't display any more native frames again. |
Ah, it's nice to see the list here, thanks for the quick reply. Perhaps that whitelist could be made user-configurable? I was specifically looking for PyOS_string_to_double (to figure out whether it's worth switching to one of the very fast native floating point parsers that exist nowadays). (So in my case, the extension is calling back into a C function implemented in libpython, not into an actual Python frame.) |
Maybe we can just do what vmprof does? (stopping at |
FWIW I ended up using a patched version of py-spy with just whatever entries I needed in WHITELISTED_PREFIXES (thanks for pointing it out, it's been very helpful), but being able to write e.g. |
In #497 I added a flag to disable most filtering. It's a bit noisy. For example, I see |
AFAICT, when profiling native extensions, py-spy includes symbols from third-party shared objects, but not from libpython (PyFoo_...) itself. This can be desirable sometimes, and was provided e.g. by the (now somewhat dormant?) vmprof profiler.
(An example application is profiling an extension that calls back into libpython and where these calls are suspected to take a significant amount of time.)
The text was updated successfully, but these errors were encountered: