-
Notifications
You must be signed in to change notification settings - Fork 431
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
Show thread names in --dump #47
Comments
I agree that this would be nice - but unfortunately getting this would be slightly involved, and I doubt I'll get to it anytime soon =(. From what I can tell, the names live on the Thread object in threading.py. To read these from another process we'd have to implement the equivalent code in rust: for threadid, thread in sys.modules['threading']._active.items():
print(threadid, thread._name)) while it doesn't look all that bad, it does mean we'd have to add logic to read python dict objects from another process in rust (for getting the threading module from the interpreter modules, getting the _active variable from the threading module globals dict, getting the items from the _active and finally getting the _name member from the Thread class It's not hard exactly, but would be a little time consuming to implement =( |
This adds the ability to show the local variables for each frame when showing the stack trace with the dump command. Currently we only support str/float/int /bool/nonetype/list/tuple/dict objects - everything else will just show the type and address. (#77). Dictionary processing also currently only works for python 3.6+, everything else will show a 'dict' object instead. This also adds the ability to show the thead names for each thread during dump. Since this relies on a bunch of dictionary lookups, this also only works for python 3.6+ (#47)
First draft of this is in #176. I added the ability to show the local variables in that PR, and once that was done getting the thread names was pretty easy. Note this is limited to python 3.6+ right now - older versions of python will still just show the threadid without the namee. |
This adds the ability to show the local variables for each frame when showing the stack trace with the dump command. Currently we only support str/float/int /bool/nonetype/list/tuple/dict objects - everything else will just show the type and address. (#77). Dictionary processing also currently only works for python 3.6+, everything else will show a 'dict' object instead. This also adds the ability to show the thead names for each thread during dump. Since this relies on a bunch of dictionary lookups, this also only works for python 3.6+ (#47)
This adds the ability to show the local variables for each frame when showing the stack trace with the dump command. Currently we only support str/float/int /bool/nonetype/list/tuple/dict objects - everything else will just show the type and address. (#77). Dictionary processing also currently only works for python 3.6+, everything else will show a 'dict' object instead. This also adds the ability to show the thead names for each thread during dump. Since this relies on a bunch of dictionary lookups, this also only works for python 3.6+ (#47)
change is in v0.2.2 release |
Python threads have names:
It would be very nice if py-spy --dump could print those names.
The text was updated successfully, but these errors were encountered: