Skip to content
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

Cross-container output only includes last component of filename #220

Closed
garrettheel opened this issue Jan 28, 2020 · 3 comments
Closed

Cross-container output only includes last component of filename #220

garrettheel opened this issue Jan 28, 2020 · 3 comments
Labels
bug Something isn't working

Comments

@garrettheel
Copy link

When running py-spy record --gil -p somepid --duration 10 --output /tmp/out.svg with py-spy==0.3.2, I'm seeing that the resulting output contains only the filename, but never a leading path.

Here's an example stack that I'm seeing with --format raw:

_handle_and_close_when_done (baseserver.py:26);handle (ggevent.py:139);handle (base_async.py:41)

I would expect the output to be something like handle (gunicorn/workers/ggevent.py:139), where the source of the file is much clearer. The example on the README suggests this should work and this has worked in the past with pyflame.

One possibly related piece of information is that py-spy is being run across containers here.

@garrettheel garrettheel changed the title Output only includes last component of filename Raw output only includes last component of filename Feb 7, 2020
@benfred benfred changed the title Raw output only includes last component of filename Cross-container output only includes last component of filename Feb 9, 2020
@benfred
Copy link
Owner

benfred commented Feb 9, 2020

This seems to be an issue with how we are detecting short filenames across containers - will get a fix in soon

@benfred benfred added the bug Something isn't working label Feb 9, 2020
benfred added a commit that referenced this issue Feb 9, 2020
When profiling from the host os to a program running in a docker container,
we were failling to shorten the filenames appropiately. Fix by using
/proc/PID/root to check if the __init__.py files exist (#220).
@benfred
Copy link
Owner

benfred commented Feb 9, 2020

This should be fixed by #223

@garrettheel
Copy link
Author

Tested this out and it fixes my issue. Looking forward to a release soon so we can take advantage of this. Thanks @benfred!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants