Giter VIP home page Giter VIP logo

py-spy's People

Contributors

adamchainz avatar akhramov avatar andrewjcg avatar auscompgeek avatar benfred avatar dependabot[bot] avatar domartynov avatar edgarsi avatar frederikaalund avatar github-actions[bot] avatar gjoseph92 avatar jarus avatar jongy avatar jugmac00 avatar krfricke avatar kurtbrose avatar kxepal avatar lize avatar marcstreeter avatar messense avatar nariman avatar nudin avatar phlogistique avatar simonrw avatar thomaswaldmann avatar timgates42 avatar toabctl avatar wmanley avatar xyb avatar zanieb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

py-spy's Issues

Rbspy as an inspiration?

My first thought on seeing this repo was that it seems to have been inspired by Julia Evans' https://github.com/rbspy/rbspy. They share some similarities in terms of being profilers of dynamic languages written in rust, using the name spy, and generating icicle graphs.

Might it be worth mentioning that inspiration somewhere in the readme?

Document VC++ Runtime requirement for Windows

Trying to run this from PowerShell it just failed silently with no message. From cmd.exe, I got a popup saying "The code execution cannot proceed because VCRUNTIME140.dll was not found. Reinstalling the program may fix this problem." We should probably document that requirement somewhere, if we can't otherwise fix it (does CPython not have the runtime?!).

analyze dump

As mentioned in the case #40, please consider add a feature to allow py-spy analyze dump files.
Rather than use --pid pid or run live target process, add an argument for loading windows dump or core dump on linux/mac. Thanks!

Relax/remove `is_python_bin` requirement

py-spy seems to work quite well for third-party binaries that embed CPython.
However is_python_bin requires that on Windows \python is in the path.

In my case that path can not easily be changed, since this third-party software is installed via an installer. What works is duplicating third_party_path\foo.exe as third_party_path\python.exe.

Would it be possible to relax/remove the is_python_bin requirement?

Invalid PID numbers are poorly reported

Basically:

durr@rwpscrape ~> sudo py-spy --pid 12345
Error: No such file or directory (os error 2)

It turns out that I initially ran into this problem when the PID I was trying to sniff went away before I had switched to actually executing py-spy. It turns out that if you pass a PID that isn't in use, you get Error: No such file or directory (os error 2).

It'd maybe be nice to have that case return something like "Error: No such file or directory (os error 2). Is that PID Valid?" or similar. as it is, I wound up flailing about a bit before I figured out the actual issue.

Clarification for the behavior of concurrent target memory reading

Hello.
As I've understood from "How does py-spy work?" readme section, the memory of the target process is read with process_vm_readv on the fly - while the process continues to run. According to man, process_vm_readv is not atomic itself, and if a sampling operation is performed through multiple reads, the whole operation is not atomic as the overall interpreter state memory potentially continues to change between readings. Is it handled somehow in py-spy, how or how does it affect accuracy if not? I think it's worth mentioning in "How does py-spy work?"

Additional dependency on perl

I found a small hiccup:
When using py-spy with the -flame option, it also depends on Perl. Not having any Perl installation, trying to execute -flame netted me a "Could not execute Perl. File not found [oserror 2]" error. After installing Perl it functioned flawlessly.

Would be cool if this dependency could be mentioned in the readme to make troubleshooting easier.

stack traces in flamegraph appear without callers

I'm running some profiles with a flame graph, and there are top-level entry points in my flame graph that are clearly not top-level entry points.

For example, the return statement of a function inside a function, https://github.com/projectfluent/python-fluent/blob/6f3b911f88c821865a80c36fc6622d0a8e0e12c9/fluent/syntax/ast.py#L63, is a top-level section in the flame graph.

Stack traces are pretty deep, but they're far from 4k, which is the only thing I found indicating stack trace depth limits.

I'm seeing this on python 2.7.10 and 3.6.5

Output raw call stack data

It would be useful (and I suspect not too difficult) to be able to retrieve the raw call stack data for an invocation of py-spy. This would allow aggregating data from many machines, and performing ad-hoc aggregations over different time ranges.

Windows 7: ANSI code to clear the rest of the line gives additional characters: `←[K`

On a German Windows cmd the output looks like this:

Collecting samples from 'pid: 17092' (python vX.Y.Z)←[K
Total Samples 598500←[K
GIL: 0.00%, Active: 200.00%, Threads: 2←[K
←[K
  %Own   %Total  OwnTime  TotalTime  Function (filename:line)
 99.40%  99.40%   572.4s    572.4s   run (foo.py:733)←[K[K
 84.10%  84.10%   109.4s    109.4s   foo (foo:4698)←[K
 11.50%  11.50%   13.13s    13.13s   foo (foo:4681)←[KK
  1.80%   1.80%    2.09s     2.09s   foo (foo:4676)←[KK
  0.90%   0.90%   0.791s    0.791s   foo (foo:4693)←[KK
  0.60%   0.60%   26.03s    26.03s   run (foo.py:728)←[K)←[KK
  0.40%   0.40%   0.555s    0.555s   foo (foo:4700)←[KK
  0.30%   0.30%   0.558s    0.558s   foo (foo:4694)←[KK2031)←[K
  0.30%   0.30%   0.508s    0.508s   foo (foo:4701)←[KK2031)←[K
  0.30%   0.30%   0.276s    0.276s   foo (foo:4695)←[KK2031)←[K
  0.20%   0.20%   0.043s    0.043s   foo (foo:4674)←[KK2031)←[K
  0.10%   0.10%   0.102s    0.102s   foo (foo:4691)←[K[K031)←[K
  0.10%   0.10%   0.035s    0.035s   foo (foo:4699)←[K[K031)←[K4)←[K
←[K
Press Control-C to quit, or ? for help.←[K
←[K
←[K

They seem to come from the macro out!:

() => (println!("\x1B[K")); // ANSI code to clear the rest of the line

In "Ubuntu" docker container on Joyent's Triton platform, py-spy exits with os error 38

Triton implements the docker API and can run sort of faux-Linux containers that are (to the best of my non-expert understanding) actually built on top of Solaris zones, as the host OS of Triton compute nodes is SmartOS, which is based on illumos, which is based on OpenSolaris, which is based on BSD and proprietary UNIX implementations.

The README says BSD is not yet supported, so I'm not surprised that it didn't work. It'd be awfully nice if it did, though, and I thought I'd open an issue in case anyone else is trying to use py-spy in a SmartOS container or another BSD or BSD-like environment.

The specific error message I get is:

Error: Function not implemented (os error 38)

Error: Couldn't find python binary

Hi,

After installing in root via

scl enable rh-python36
cargo install py-spy"

And running as root via .cargo/bin/py-spy --pid 11792
I have this error py-spy is unable to find the python binary.

I also have tried as the same user as the process with the virtualenvironment loaded but I have the same error message.
My app is in a virtual environment /home/myuser/env36/flexssl/bin/python3
My OS is EL7

I don't understand how the code lookup for the python binary path

Best regards,

support uwsgi

Currently profiling uwsgi fails with a 'no python binary could be found' error.

Analyse memory usage

Hi there,

First of all, great job! I managed to get this running with a project I develop, and it's pretty neat! :-)

So, I wanted to ask, is there any plan to include, in py-spy, the support to also display memory usage inside the "spied" processes as well? I've been trying memory dump libraries and it's been a PITA to deal with them, some of them work but they impose a high burden on the process in production, and I really need a reliable and robust way to investigate the memory usage of my project, so I thought this project could be a very good starting place to have a tool for this too - since it can attach to an already-running process, without slowing it down.

Thanks!
Diogo

callgrind output?

A suggestion: consider providing profiling output in the callgrind format, as there already exists excellent visualizers (e.g., kcachegrind) for it. (I'm writing this same issue to each and every python profiler project that I run into and that appears interesting :-))

Install fails on Win 10

I'm getting the following error message. Please let me know if I can provide any additional information.

Python 3.7.0 and 3.7.1. Pip 18.0 and 18.1. Win 10 64-bit.

Could not find a version that satisfies the requirement py-spy (from versions: )
No matching distribution found for py-spy

Better flamegraph readability for deep call stacks

When the call stacks are deep, the flamegraph annotations are becoming truncated and it's difficult (or impossible) to see which function took most time to execute. Perhaps you could introduce an option to trim the beginning of the function names, or generate a (much) higher resolution flamegraph?

Thanks!

Profile Native Extensions

Right now we are figuring out the call stack of the Python program by inspecting the PyInterpreterState/PyThreadState/PyFrameObject variables found in the target python program. This means we don't get information about time spent in non-python threads and time spent in native extensions to python (like extension code written in Cython or C++)

It could be useful to profile these native extensions in addition to the Python call stacks. It might be possible to use something like libunwind to augment the Python call stack to get this information.

edit: There is a prerelease here pip install py-spy==0.2.0.dev4 that can profile native extensions of 64-bit Linux/Windows.

Allow collecting data for flame graph until interrupted

It would be useful if py-spy could be run in such a way that it would collect data for the flame graph until interrupted by a signal.

My use case would be to write a Django middleware that would attach py-spy at the start of a request, and interrupt it when the request is done, and then return the flame graph svg to the client instead of the actual content.
This would also allow to write a context manager that starts/stops py-spy during the run of a single block of code.

show os thread id's in --dump

It would be nice to see the OS thread id's in --dump, that is, the id that gettid() returns. With that information you can correlate against ps -L or top (after pressing H), on linux at least.

"Error: Failed to find python version from target process" on macOS

I'm getting this error for a Pyenv-installed Python running an Ipython kernel. Running with RUST_LOG=info, I get

 INFO 2018-09-07T06:14:57Z: py_spy::python_spy: Getting version from python binary BSS
 INFO 2018-09-07T06:14:57Z: py_spy::python_spy: Failed to get version from BSS section: failed to find version string
 INFO 2018-09-07T06:14:57Z: py_spy::python_spy: Trying to get version from path: /Users/hermann/.pyenv/versions/3.6.6/Python.framework/Versions/3.6/Resources/Python.app/Contents/MacOS/Python
Error: Failed to find python version from target process

Clarify difference between {%own,%total} and {owntime,totaltime}?

Naively, one would expect that %own is just owntime/(total time spent profiling the program) and similarly %total=totaltime/(total time spent profiling the program), but this is clearly not the case (for example sorting by %own and by owntime give different results).

Could you clarify what %own actually means?

Thanks!

Invalid pid: ParseIntError

I'm getting the following error

thread 'main' panicked at 'invalid pid: ParseIntError { kind: InvalidDigit }', libcore/result.rs:945:5
note: Run with `RUST_BACKTRACE=1` for a backtrace.

When I'm running py-spy -pid 20

Mark time spent in 'poll()' as idle

From HN:

Also, it would be nice to somehow eliminate time spent in poll() from the results. I'm profiling a server process and 99.9% of the time is spent in a poll function. Perhaps there could be an option to disregard time spent in system calls rather than user code. Most of the time I'm interested in profiling only user code.

"Killed: 9"?

Hello there,

Thank you for your work on the tool! I'm very excited to use it, but seem to have hit a snag:

17:12 ~/code/optimizely/src/www
$ pstree 98465
--- 98465 swilson /Users/swilson/code/optimizely/.virtualenv/www/test/bin/python /Users/swilson/code/optimizely/.virtualenv/www/test/bin/pytest --pdb services_test/client_tes [truncated]

17:13 ~/code/optimizely/src/www
$ sudo py-spy --pid 98465 -f hottt
Killed: 9

I've ensured that the PID of pytest isn't moving around; i.e., it's a long-running process with no child processes. Yet while it's running, I get the output Killed: 9, exit status 137.

Python 2.7.12
py-spy 0.1.8
macOS 12.13.6

Let me know if I can provide any other details!

Docker with uWSGI: Failed to find python version from target process

I've got a docker image which I'm getting this error in:

root@560ece42e0fc:/usr/src/app# pip list | grep py-spy
py-spy                 0.1.7
root@560ece42e0fc:/usr/src/app# RUST_LOG=info py-spy --pid 1
 INFO 2018-09-21T15:24:05Z: py_spy: Command line args: ArgMatches { args: {"pid": MatchedArg { occurs: 1, indices: [2], vals: ["1"] }, "rate": MatchedArg { occurs: 0, indices: [3], vals: ["200"] }, "duration": MatchedArg { occurs: 0, indices: [4], vals: ["2"] }}, subcommand: None, usage: Some("USAGE:\n    py-spy [FLAGS] [OPTIONS] --pid <pid> [python_program]...") }
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: Found process binary @ '/bin/bash'
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: Got virtual memory maps from pid 1:
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 0000000000400000-0000000000500000 r-x /bin/bash
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 0000000000700000-0000000000703000 r-- /bin/bash
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 0000000000703000-000000000070c000 rw- /bin/bash
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 000000000070c000-0000000000716000 rw-
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 0000000000a1c000-0000000000a36000 rw- [heap]
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff14f31f000-00007ff14f329000 r-x /lib/x86_64-linux-gnu/libnss_files-2.24.so
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff14f329000-00007ff14f529000 --- /lib/x86_64-linux-gnu/libnss_files-2.24.so
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff14f529000-00007ff14f52a000 r-- /lib/x86_64-linux-gnu/libnss_files-2.24.so
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff14f52a000-00007ff14f52b000 rw- /lib/x86_64-linux-gnu/libnss_files-2.24.so
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff14f52b000-00007ff14f531000 rw-
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff14f531000-00007ff14f53c000 r-x /lib/x86_64-linux-gnu/libnss_nis-2.24.so
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff14f53c000-00007ff14f73b000 --- /lib/x86_64-linux-gnu/libnss_nis-2.24.so
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff14f73b000-00007ff14f73c000 r-- /lib/x86_64-linux-gnu/libnss_nis-2.24.so
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff14f73c000-00007ff14f73d000 rw- /lib/x86_64-linux-gnu/libnss_nis-2.24.so
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff14f73d000-00007ff14f751000 r-x /lib/x86_64-linux-gnu/libnsl-2.24.so
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff14f751000-00007ff14f951000 --- /lib/x86_64-linux-gnu/libnsl-2.24.so
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff14f951000-00007ff14f952000 r-- /lib/x86_64-linux-gnu/libnsl-2.24.so
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff14f952000-00007ff14f953000 rw- /lib/x86_64-linux-gnu/libnsl-2.24.so
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff14f953000-00007ff14f955000 rw-
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff14f955000-00007ff14f95c000 r-x /lib/x86_64-linux-gnu/libnss_compat-2.24.so
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff14f95c000-00007ff14fb5b000 --- /lib/x86_64-linux-gnu/libnss_compat-2.24.so
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff14fb5b000-00007ff14fb5c000 r-- /lib/x86_64-linux-gnu/libnss_compat-2.24.so
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff14fb5c000-00007ff14fb5d000 rw- /lib/x86_64-linux-gnu/libnss_compat-2.24.so
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff14fb5d000-00007ff14fcf2000 r-x /lib/x86_64-linux-gnu/libc-2.24.so
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff14fcf2000-00007ff14fef2000 --- /lib/x86_64-linux-gnu/libc-2.24.so
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff14fef2000-00007ff14fef6000 r-- /lib/x86_64-linux-gnu/libc-2.24.so
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff14fef6000-00007ff14fef8000 rw- /lib/x86_64-linux-gnu/libc-2.24.so
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff14fef8000-00007ff14fefc000 rw-
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff14fefc000-00007ff14feff000 r-x /lib/x86_64-linux-gnu/libdl-2.24.so
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff14feff000-00007ff1500fe000 --- /lib/x86_64-linux-gnu/libdl-2.24.so
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff1500fe000-00007ff1500ff000 r-- /lib/x86_64-linux-gnu/libdl-2.24.so
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff1500ff000-00007ff150100000 rw- /lib/x86_64-linux-gnu/libdl-2.24.so
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff150100000-00007ff150126000 r-x /lib/x86_64-linux-gnu/libtinfo.so.5.9
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff150126000-00007ff150325000 --- /lib/x86_64-linux-gnu/libtinfo.so.5.9
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff150325000-00007ff150329000 r-- /lib/x86_64-linux-gnu/libtinfo.so.5.9
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff150329000-00007ff15032a000 rw- /lib/x86_64-linux-gnu/libtinfo.so.5.9
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff15032a000-00007ff15034d000 r-x /lib/x86_64-linux-gnu/ld-2.24.so
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff150393000-00007ff1503c4000 r-- /usr/lib/locale/C.UTF-8/LC_CTYPE
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff1503c4000-00007ff1503c5000 r-- /usr/lib/locale/C.UTF-8/LC_NUMERIC
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff1503c5000-00007ff1503c6000 r-- /usr/lib/locale/C.UTF-8/LC_TIME
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff1503c6000-00007ff150539000 r-- /usr/lib/locale/C.UTF-8/LC_COLLATE
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff150539000-00007ff15053a000 r-- /usr/lib/locale/C.UTF-8/LC_MONETARY
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff15053a000-00007ff15053b000 r-- /usr/lib/locale/C.UTF-8/LC_MESSAGES/SYS_LC_MESSAGES
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff15053b000-00007ff15053c000 r-- /usr/lib/locale/C.UTF-8/LC_PAPER
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff15053c000-00007ff15053d000 r-- /usr/lib/locale/C.UTF-8/LC_NAME
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff15053d000-00007ff15053e000 r-- /usr/lib/locale/C.UTF-8/LC_ADDRESS
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff15053e000-00007ff15053f000 r-- /usr/lib/locale/C.UTF-8/LC_TELEPHONE
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff15053f000-00007ff150541000 rw-
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff150541000-00007ff150542000 r-- /usr/lib/locale/C.UTF-8/LC_MEASUREMENT
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff150542000-00007ff150549000 r-- /usr/lib/x86_64-linux-gnu/gconv/gconv-modules.cache
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff150549000-00007ff15054a000 r-- /usr/lib/locale/C.UTF-8/LC_IDENTIFICATION
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff15054a000-00007ff15054d000 rw-
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff15054d000-00007ff15054e000 r-- /lib/x86_64-linux-gnu/ld-2.24.so
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff15054e000-00007ff15054f000 rw- /lib/x86_64-linux-gnu/ld-2.24.so
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff15054f000-00007ff150550000 rw-
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ffcd70fa000-00007ffcd711b000 rw- [stack]
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ffcd7174000-00007ffcd7176000 r-x [vdso]
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: ffffffffff600000-ffffffffff601000 r-x [vsyscall]
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: Getting version from python binary BSS
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: Failed to get version from BSS section: failed to find version string
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: Trying to get version from path: /bin/bash
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: Failed to connect to process, retrying. Error: Failed to find python version from target process
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: Found process binary @ '/bin/bash'
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: Got virtual memory maps from pid 1:
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 0000000000400000-0000000000500000 r-x /bin/bash
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 0000000000700000-0000000000703000 r-- /bin/bash
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 0000000000703000-000000000070c000 rw- /bin/bash
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 000000000070c000-0000000000716000 rw-
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 0000000000a1c000-0000000000a36000 rw- [heap]
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff14f31f000-00007ff14f329000 r-x /lib/x86_64-linux-gnu/libnss_files-2.24.so
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff14f329000-00007ff14f529000 --- /lib/x86_64-linux-gnu/libnss_files-2.24.so
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff14f529000-00007ff14f52a000 r-- /lib/x86_64-linux-gnu/libnss_files-2.24.so
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff14f52a000-00007ff14f52b000 rw- /lib/x86_64-linux-gnu/libnss_files-2.24.so
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff14f52b000-00007ff14f531000 rw-
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff14f531000-00007ff14f53c000 r-x /lib/x86_64-linux-gnu/libnss_nis-2.24.so
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff14f53c000-00007ff14f73b000 --- /lib/x86_64-linux-gnu/libnss_nis-2.24.so
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff14f73b000-00007ff14f73c000 r-- /lib/x86_64-linux-gnu/libnss_nis-2.24.so
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff14f73c000-00007ff14f73d000 rw- /lib/x86_64-linux-gnu/libnss_nis-2.24.so
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff14f73d000-00007ff14f751000 r-x /lib/x86_64-linux-gnu/libnsl-2.24.so
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff14f751000-00007ff14f951000 --- /lib/x86_64-linux-gnu/libnsl-2.24.so
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff14f951000-00007ff14f952000 r-- /lib/x86_64-linux-gnu/libnsl-2.24.so
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff14f952000-00007ff14f953000 rw- /lib/x86_64-linux-gnu/libnsl-2.24.so
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff14f953000-00007ff14f955000 rw-
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff14f955000-00007ff14f95c000 r-x /lib/x86_64-linux-gnu/libnss_compat-2.24.so
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff14f95c000-00007ff14fb5b000 --- /lib/x86_64-linux-gnu/libnss_compat-2.24.so
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff14fb5b000-00007ff14fb5c000 r-- /lib/x86_64-linux-gnu/libnss_compat-2.24.so
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff14fb5c000-00007ff14fb5d000 rw- /lib/x86_64-linux-gnu/libnss_compat-2.24.so
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff14fb5d000-00007ff14fcf2000 r-x /lib/x86_64-linux-gnu/libc-2.24.so
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff14fcf2000-00007ff14fef2000 --- /lib/x86_64-linux-gnu/libc-2.24.so
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff14fef2000-00007ff14fef6000 r-- /lib/x86_64-linux-gnu/libc-2.24.so
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff14fef6000-00007ff14fef8000 rw- /lib/x86_64-linux-gnu/libc-2.24.so
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff14fef8000-00007ff14fefc000 rw-
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff14fefc000-00007ff14feff000 r-x /lib/x86_64-linux-gnu/libdl-2.24.so
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff14feff000-00007ff1500fe000 --- /lib/x86_64-linux-gnu/libdl-2.24.so
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff1500fe000-00007ff1500ff000 r-- /lib/x86_64-linux-gnu/libdl-2.24.so
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff1500ff000-00007ff150100000 rw- /lib/x86_64-linux-gnu/libdl-2.24.so
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff150100000-00007ff150126000 r-x /lib/x86_64-linux-gnu/libtinfo.so.5.9
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff150126000-00007ff150325000 --- /lib/x86_64-linux-gnu/libtinfo.so.5.9
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff150325000-00007ff150329000 r-- /lib/x86_64-linux-gnu/libtinfo.so.5.9
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff150329000-00007ff15032a000 rw- /lib/x86_64-linux-gnu/libtinfo.so.5.9
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff15032a000-00007ff15034d000 r-x /lib/x86_64-linux-gnu/ld-2.24.so
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff150393000-00007ff1503c4000 r-- /usr/lib/locale/C.UTF-8/LC_CTYPE
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff1503c4000-00007ff1503c5000 r-- /usr/lib/locale/C.UTF-8/LC_NUMERIC
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff1503c5000-00007ff1503c6000 r-- /usr/lib/locale/C.UTF-8/LC_TIME
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff1503c6000-00007ff150539000 r-- /usr/lib/locale/C.UTF-8/LC_COLLATE
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff150539000-00007ff15053a000 r-- /usr/lib/locale/C.UTF-8/LC_MONETARY
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff15053a000-00007ff15053b000 r-- /usr/lib/locale/C.UTF-8/LC_MESSAGES/SYS_LC_MESSAGES
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff15053b000-00007ff15053c000 r-- /usr/lib/locale/C.UTF-8/LC_PAPER
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff15053c000-00007ff15053d000 r-- /usr/lib/locale/C.UTF-8/LC_NAME
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff15053d000-00007ff15053e000 r-- /usr/lib/locale/C.UTF-8/LC_ADDRESS
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff15053e000-00007ff15053f000 r-- /usr/lib/locale/C.UTF-8/LC_TELEPHONE
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff15053f000-00007ff150541000 rw-
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff150541000-00007ff150542000 r-- /usr/lib/locale/C.UTF-8/LC_MEASUREMENT
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff150542000-00007ff150549000 r-- /usr/lib/x86_64-linux-gnu/gconv/gconv-modules.cache
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff150549000-00007ff15054a000 r-- /usr/lib/locale/C.UTF-8/LC_IDENTIFICATION
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff15054a000-00007ff15054d000 rw-
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff15054d000-00007ff15054e000 r-- /lib/x86_64-linux-gnu/ld-2.24.so
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff15054e000-00007ff15054f000 rw- /lib/x86_64-linux-gnu/ld-2.24.so
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff15054f000-00007ff150550000 rw-
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ffcd70fa000-00007ffcd711b000 rw- [stack]
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ffcd7174000-00007ffcd7176000 r-x [vdso]
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: ffffffffff600000-ffffffffff601000 r-x [vsyscall]
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: Getting version from python binary BSS
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: Failed to get version from BSS section: failed to find version string
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: Trying to get version from path: /bin/bash
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: Failed to connect to process, retrying. Error: Failed to find python version from target process
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: Found process binary @ '/bin/bash'
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: Got virtual memory maps from pid 1:
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 0000000000400000-0000000000500000 r-x /bin/bash
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 0000000000700000-0000000000703000 r-- /bin/bash
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 0000000000703000-000000000070c000 rw- /bin/bash
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 000000000070c000-0000000000716000 rw-
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 0000000000a1c000-0000000000a36000 rw- [heap]
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff14f31f000-00007ff14f329000 r-x /lib/x86_64-linux-gnu/libnss_files-2.24.so
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff14f329000-00007ff14f529000 --- /lib/x86_64-linux-gnu/libnss_files-2.24.so
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff14f529000-00007ff14f52a000 r-- /lib/x86_64-linux-gnu/libnss_files-2.24.so
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff14f52a000-00007ff14f52b000 rw- /lib/x86_64-linux-gnu/libnss_files-2.24.so
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff14f52b000-00007ff14f531000 rw-
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff14f531000-00007ff14f53c000 r-x /lib/x86_64-linux-gnu/libnss_nis-2.24.so
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff14f53c000-00007ff14f73b000 --- /lib/x86_64-linux-gnu/libnss_nis-2.24.so
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff14f73b000-00007ff14f73c000 r-- /lib/x86_64-linux-gnu/libnss_nis-2.24.so
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff14f73c000-00007ff14f73d000 rw- /lib/x86_64-linux-gnu/libnss_nis-2.24.so
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff14f73d000-00007ff14f751000 r-x /lib/x86_64-linux-gnu/libnsl-2.24.so
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff14f751000-00007ff14f951000 --- /lib/x86_64-linux-gnu/libnsl-2.24.so
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff14f951000-00007ff14f952000 r-- /lib/x86_64-linux-gnu/libnsl-2.24.so
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff14f952000-00007ff14f953000 rw- /lib/x86_64-linux-gnu/libnsl-2.24.so
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff14f953000-00007ff14f955000 rw-
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff14f955000-00007ff14f95c000 r-x /lib/x86_64-linux-gnu/libnss_compat-2.24.so
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff14f95c000-00007ff14fb5b000 --- /lib/x86_64-linux-gnu/libnss_compat-2.24.so
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff14fb5b000-00007ff14fb5c000 r-- /lib/x86_64-linux-gnu/libnss_compat-2.24.so
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff14fb5c000-00007ff14fb5d000 rw- /lib/x86_64-linux-gnu/libnss_compat-2.24.so
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff14fb5d000-00007ff14fcf2000 r-x /lib/x86_64-linux-gnu/libc-2.24.so
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff14fcf2000-00007ff14fef2000 --- /lib/x86_64-linux-gnu/libc-2.24.so
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff14fef2000-00007ff14fef6000 r-- /lib/x86_64-linux-gnu/libc-2.24.so
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff14fef6000-00007ff14fef8000 rw- /lib/x86_64-linux-gnu/libc-2.24.so
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff14fef8000-00007ff14fefc000 rw-
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff14fefc000-00007ff14feff000 r-x /lib/x86_64-linux-gnu/libdl-2.24.so
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff14feff000-00007ff1500fe000 --- /lib/x86_64-linux-gnu/libdl-2.24.so
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff1500fe000-00007ff1500ff000 r-- /lib/x86_64-linux-gnu/libdl-2.24.so
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff1500ff000-00007ff150100000 rw- /lib/x86_64-linux-gnu/libdl-2.24.so
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff150100000-00007ff150126000 r-x /lib/x86_64-linux-gnu/libtinfo.so.5.9
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff150126000-00007ff150325000 --- /lib/x86_64-linux-gnu/libtinfo.so.5.9
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff150325000-00007ff150329000 r-- /lib/x86_64-linux-gnu/libtinfo.so.5.9
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff150329000-00007ff15032a000 rw- /lib/x86_64-linux-gnu/libtinfo.so.5.9
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff15032a000-00007ff15034d000 r-x /lib/x86_64-linux-gnu/ld-2.24.so
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff150393000-00007ff1503c4000 r-- /usr/lib/locale/C.UTF-8/LC_CTYPE
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff1503c4000-00007ff1503c5000 r-- /usr/lib/locale/C.UTF-8/LC_NUMERIC
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff1503c5000-00007ff1503c6000 r-- /usr/lib/locale/C.UTF-8/LC_TIME
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff1503c6000-00007ff150539000 r-- /usr/lib/locale/C.UTF-8/LC_COLLATE
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff150539000-00007ff15053a000 r-- /usr/lib/locale/C.UTF-8/LC_MONETARY
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff15053a000-00007ff15053b000 r-- /usr/lib/locale/C.UTF-8/LC_MESSAGES/SYS_LC_MESSAGES
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff15053b000-00007ff15053c000 r-- /usr/lib/locale/C.UTF-8/LC_PAPER
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff15053c000-00007ff15053d000 r-- /usr/lib/locale/C.UTF-8/LC_NAME
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff15053d000-00007ff15053e000 r-- /usr/lib/locale/C.UTF-8/LC_ADDRESS
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff15053e000-00007ff15053f000 r-- /usr/lib/locale/C.UTF-8/LC_TELEPHONE
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff15053f000-00007ff150541000 rw-
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff150541000-00007ff150542000 r-- /usr/lib/locale/C.UTF-8/LC_MEASUREMENT
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff150542000-00007ff150549000 r-- /usr/lib/x86_64-linux-gnu/gconv/gconv-modules.cache
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff150549000-00007ff15054a000 r-- /usr/lib/locale/C.UTF-8/LC_IDENTIFICATION
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff15054a000-00007ff15054d000 rw-
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff15054d000-00007ff15054e000 r-- /lib/x86_64-linux-gnu/ld-2.24.so
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff15054e000-00007ff15054f000 rw- /lib/x86_64-linux-gnu/ld-2.24.so
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ff15054f000-00007ff150550000 rw-
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ffcd70fa000-00007ffcd711b000 rw- [stack]
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: 00007ffcd7174000-00007ffcd7176000 r-x [vdso]
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: map: ffffffffff600000-ffffffffff601000 r-x [vsyscall]
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: Getting version from python binary BSS
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: Failed to get version from BSS section: failed to find version string
 INFO 2018-09-21T15:24:05Z: py_spy::python_spy: Trying to get version from path: /bin/bash
Error: Failed to find python version from target process

root@560ece42e0fc:/usr/src/app# python --version
Python 2.7.15

I'm not entirely sure if this is a bug, or just me missing something.

Error: Failed to find a python interpreter in the .data section

Hi @benfred,

Loving the goals for this project, but understand it's a little early.

Running this on Windows 10, Python 3.6 x64, profiling another instance of the same version I get this.

$ pip install py-spy
$ c:\Python36\scripts\py-spy --pid 4024
Error: Failed to find a python interpreter in the .data section

Likely a separate problem, but profiling a Python 2.7 x64 instance yields this.

$ c:\Python36\scripts\py-spy --pid 1140
Error: Unsupported version of Python: 2.2.2

The Python instances were merely started, with nothing much going on.

$ c:\Python36\python.exe
Python 3.6.1 (v3.6.1:69c0db5, Mar 21 2017, 18:41:36) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()

$ c:\Python27\python.exe
Python 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 20:53:40) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>

Any way I can work around this?

Doesn't like to run inside docker

Running this inside a docker container, running as root. I'm getting the following error message.

$ py-spy --flame profile.svg -- python manage.py runserver 0:8000

Permission Denied: Try running again with elevated permissions by going 'sudo env "PATH=$PATH" !!'

py27 win64 version on PyPI

pip install py-spy yields Could not find a version that satisfies the requirement py-spy. 'I see a py27-win32 version and a py35/6-win64 version on PyPI but no py27 win64. If this is not supported perhaps the readme could reflect this.

py-spy GPL License

Hi,
I really like the project. But I'm having concerns using it in our web application backend due to the GPL license of py-spy.

Are there any license issues using py-spy on our servers?

Best,
Stefan

Duration seems to depend on the number of processes, not seconds. Or on threads...

I'm testing the flamegraph for a minute on PID 502 calling

py-spy -p 502 -d 60 -f /tmp/flame

on a Linux CentOS 5 machine,

I get a progress bar that only moves slowly.
I'm using the default sample rate of 1000.

It seems that duration seconds doesn't consider cases where
there's less samples than the maximum defined. Or see 2nd
theory below...

Output:
Sampling process 1000 times a second for 60 seconds
████████████████████████████████████████████████████████████████████████████████████████████████████████████████ 60000/60000
Wrote flame graph '/tmp/flame'. Samples: 60000 Errors: 0

Also in this scenario, the flamegraph might be wrong/confusing,
The generated svg file has a first line
Function all: (255,466 samples 100%)

Which is inconsistent with the collected 60000 samples.

The next line shows " /main.py:25)" at 59999 samples
and the rest at "_bootstrap" (threading.py:884) 195,457 samples,
so it's possible that the default 1000 samples a second are taken,
but those from threads don't count towards the duration.

The job ran about 4 minutes, so that would work out.

get_process_exe on windows is_python_bin check

Hi,

I am still wondering how to deal with "Couldn't find binary in virtual memory maps". In this case the python executable is moved or renamed on Windows. This happens to me with the latest 0.1.6 after #34.

It looks like Windows somehow caches the old path such as "c:\foo\bar\Python26\python.exe" on Windows 2008 R2. (I know, python26 and Windows 2008 is old, but may be unrelated to the issue here I think.)
It was moved to c:\foo\bar.moved. Then the target process started. Ran py-spy on the target pid.
It seems that utils::get_process_exe and QueryFullProcessImageNameW return the old path "c:\foo\bar" not "c:\foo\bar.moved"

I searched and ran various utilities to find c:\boo\bar and why. Try clear some memory caches and restarted some windows services etc, nothing works. Logout doesn't help.
Only need to restart the machine. Then it found c:\boo\bar.renamed, and worked.

To work aroud, I can change not to move/rename the deployment. But because the "freezing" process is rare, hard to reproduce.
It's difficult to miss the py-spy opportunity and change the process, restart, and reproduce. I also don't have the pdb for the old python26 distribution in order to get the stack trace. So really need to get help by using py-spy.

Also try build a patch and bypass "is_python_bin" check. But it needs Rust on Windows. Have not found scripts eg. for travis, and found no quick Docker images. Is there instruction for building on Windows?

Also wonder if py-spy can analyze a full or mini dump on Windows or core dump on Linux/Mac, rather than monitoring on a live process. Like to this in a separate issue.

Thanks in advance for your help and advice. py-spy is awesome!

Here were the steps:

c:\foo\bar\Python26 was installed.

It was moved to c:\foo\bar.moved\Python26

Then started the target

c:\foo\bar.moved\Python26\python
>>> import os
>>> os.getpid()
4888
>>>

In another admin window cmd:

set RUST_LOG=info
c:\foo\bar.moved\Python26\scripts\py-spy --pid 4888

py-spy logs:

c:\foo\bar.moved\Python26>Scripts\py-spy.exe --pid 4888
INFO 2018-09-19T15:23:58Z: py_spy: Command line args: ArgMatches { args: {"duration": MatchedArg { occurs: 0, indices: [4], vals: ["2"] }, "rate": MatchedArg { occurs: 0
: ["200"] }, "pid": MatchedArg { occurs: 1, indices: [2], vals: ["4888"] }}, subcommand: None, usage: Some("USAGE:\n    py-spy.exe [FLAGS] [OPTIONS] --pid <pid> [python_p
INFO 2018-09-19T15:23:58Z: py_spy::python_spy: Found process binary @ 'c:\foo\bar\Python26\python.exe'
INFO 2018-09-19T15:23:58Z: py_spy::python_spy: Got virtual memory maps from pid 4888:
INFO 2018-09-19T15:23:58Z: py_spy::python_spy: map: 000000001d000000-000000001d00b000 rwx c:\foo\bar.moved\Python26\python.exe
INFO 2018-09-19T15:23:58Z: py_spy::python_spy: map: 0000000077190000-000000007733a000 rwx C:\Windows\SYSTEM32\ntdll.dll
INFO 2018-09-19T15:23:58Z: py_spy::python_spy: map: 0000000076f70000-000000007708f000 rwx C:\Windows\system32\kernel32.dll
INFO 2018-09-19T15:23:58Z: py_spy::python_spy: map: 000007fefd250000-000007fefd2ba000 rwx C:\Windows\system32\KERNELBASE.dll
INFO 2018-09-19T15:23:58Z: py_spy::python_spy: map: 000007fefced0000-000007fefcf50000 rwx C:\Windows\system32\ctiuser.dll
INFO 2018-09-19T15:23:58Z: py_spy::python_spy: map: 000007fefd890000-000007fefd8dd000 rwx C:\Windows\system32\WS2_32.dll
INFO 2018-09-19T15:23:58Z: py_spy::python_spy: map: 000007fefd950000-000007fefd9ef000 rwx C:\Windows\system32\msvcrt.dll
INFO 2018-09-19T15:23:58Z: py_spy::python_spy: map: 000007fefd9f0000-000007fefdb1d000 rwx C:\Windows\system32\RPCRT4.dll
INFO 2018-09-19T15:23:58Z: py_spy::python_spy: map: 000007feff040000-000007feff048000 rwx C:\Windows\system32\NSI.dll
INFO 2018-09-19T15:23:58Z: py_spy::python_spy: map: 0000000077360000-0000000077367000 rwx C:\Windows\system32\PSAPI.DLL
INFO 2018-09-19T15:23:58Z: py_spy::python_spy: map: 000007fefce20000-000007fefce29000 rwx C:\Windows\system32\FLTLIB.DLL
INFO 2018-09-19T15:23:58Z: py_spy::python_spy: map: 0000000077090000-000000007718a000 rwx C:\Windows\system32\USER32.dll
INFO 2018-09-19T15:23:58Z: py_spy::python_spy: map: 000007fefd8e0000-000007fefd947000 rwx C:\Windows\system32\GDI32.dll
INFO 2018-09-19T15:23:58Z: py_spy::python_spy: map: 000007feff030000-000007feff03e000 rwx C:\Windows\system32\LPK.dll
INFO 2018-09-19T15:23:58Z: py_spy::python_spy: map: 000007fefd380000-000007fefd44b000 rwx C:\Windows\system32\USP10.dll
INFO 2018-09-19T15:23:58Z: py_spy::python_spy: map: 000007feff3c0000-000007feff49b000 rwx C:\Windows\system32\ADVAPI32.dll
INFO 2018-09-19T15:23:58Z: py_spy::python_spy: map: 000007fefdfd0000-000007fefdfef000 rwx C:\Windows\SYSTEM32\sechost.dll
INFO 2018-09-19T15:23:58Z: py_spy::python_spy: map: 000000001e000000-000000001e2b4000 rwx c:\foo\bar.moved\Python26\python26.dll
INFO 2018-09-19T15:23:58Z: py_spy::python_spy: map: 000007fefe2a0000-000007feff02a000 rwx C:\Windows\system32\SHELL32.dll
INFO 2018-09-19T15:23:58Z: py_spy::python_spy: map: 000007fefdb20000-000007fefdb91000 rwx C:\Windows\system32\SHLWAPI.dll
INFO 2018-09-19T15:23:58Z: py_spy::python_spy: map: 0000000072d90000-0000000072e33000 rwx C:\Windows\WinSxS\amd64_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.6161_none
VCR90.dll
INFO 2018-09-19T15:23:58Z: py_spy::python_spy: map: 000007fefdba0000-000007fefdbce000 rwx C:\Windows\system32\IMM32.DLL
INFO 2018-09-19T15:23:58Z: py_spy::python_spy: map: 000007feff210000-000007feff319000 rwx C:\Windows\system32\MSCTF.dll
INFO 2018-09-19T15:23:58Z: py_spy::python_spy: Failed to connect to process, retrying. Error: Couldn't find binary in virtual memory maps
INFO 2018-09-19T15:23:58Z: py_spy::python_spy: Found process binary @ 'c:\foo\bar\Python26\python.exe'
INFO 2018-09-19T15:23:58Z: py_spy::python_spy: Got virtual memory maps from pid 4888:
INFO 2018-09-19T15:23:58Z: py_spy::python_spy: map: 000000001d000000-000000001d00b000 rwx c:\foo\bar.moved\Python26\python.exe
INFO 2018-09-19T15:23:58Z: py_spy::python_spy: map: 0000000077190000-000000007733a000 rwx C:\Windows\SYSTEM32\ntdll.dll
INFO 2018-09-19T15:23:58Z: py_spy::python_spy: map: 0000000076f70000-000000007708f000 rwx C:\Windows\system32\kernel32.dll
INFO 2018-09-19T15:23:58Z: py_spy::python_spy: map: 000007fefd250000-000007fefd2ba000 rwx C:\Windows\system32\KERNELBASE.dll
INFO 2018-09-19T15:23:58Z: py_spy::python_spy: map: 000007fefced0000-000007fefcf50000 rwx C:\Windows\system32\ctiuser.dll
INFO 2018-09-19T15:23:58Z: py_spy::python_spy: map: 000007fefd890000-000007fefd8dd000 rwx C:\Windows\system32\WS2_32.dll
INFO 2018-09-19T15:23:58Z: py_spy::python_spy: map: 000007fefd950000-000007fefd9ef000 rwx C:\Windows\system32\msvcrt.dll
INFO 2018-09-19T15:23:58Z: py_spy::python_spy: map: 000007fefd9f0000-000007fefdb1d000 rwx C:\Windows\system32\RPCRT4.dll
INFO 2018-09-19T15:23:58Z: py_spy::python_spy: map: 000007feff040000-000007feff048000 rwx C:\Windows\system32\NSI.dll
INFO 2018-09-19T15:23:58Z: py_spy::python_spy: map: 0000000077360000-0000000077367000 rwx C:\Windows\system32\PSAPI.DLL
INFO 2018-09-19T15:23:58Z: py_spy::python_spy: map: 000007fefce20000-000007fefce29000 rwx C:\Windows\system32\FLTLIB.DLL
INFO 2018-09-19T15:23:58Z: py_spy::python_spy: map: 0000000077090000-000000007718a000 rwx C:\Windows\system32\USER32.dll
INFO 2018-09-19T15:23:58Z: py_spy::python_spy: map: 000007fefd8e0000-000007fefd947000 rwx C:\Windows\system32\GDI32.dll
INFO 2018-09-19T15:23:58Z: py_spy::python_spy: map: 000007feff030000-000007feff03e000 rwx C:\Windows\system32\LPK.dll
INFO 2018-09-19T15:23:58Z: py_spy::python_spy: map: 000007fefd380000-000007fefd44b000 rwx C:\Windows\system32\USP10.dll
INFO 2018-09-19T15:23:58Z: py_spy::python_spy: map: 000007feff3c0000-000007feff49b000 rwx C:\Windows\system32\ADVAPI32.dll
INFO 2018-09-19T15:23:58Z: py_spy::python_spy: map: 000007fefdfd0000-000007fefdfef000 rwx C:\Windows\SYSTEM32\sechost.dll
INFO 2018-09-19T15:23:58Z: py_spy::python_spy: map: 000000001e000000-000000001e2b4000 rwx c:\foo\bar.moved\Python26\python26.dll
INFO 2018-09-19T15:23:58Z: py_spy::python_spy: map: 000007fefe2a0000-000007feff02a000 rwx C:\Windows\system32\SHELL32.dll
INFO 2018-09-19T15:23:58Z: py_spy::python_spy: map: 000007fefdb20000-000007fefdb91000 rwx C:\Windows\system32\SHLWAPI.dll
INFO 2018-09-19T15:23:58Z: py_spy::python_spy: map: 0000000072d90000-0000000072e33000 rwx C:\Windows\WinSxS\amd64_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.6161_none
VCR90.dll
INFO 2018-09-19T15:23:58Z: py_spy::python_spy: map: 000007fefdba0000-000007fefdbce000 rwx C:\Windows\system32\IMM32.DLL
INFO 2018-09-19T15:23:58Z: py_spy::python_spy: map: 000007feff210000-000007feff319000 rwx C:\Windows\system32\MSCTF.dll
INFO 2018-09-19T15:23:58Z: py_spy::python_spy: Failed to connect to process, retrying. Error: Couldn't find binary in virtual memory maps
INFO 2018-09-19T15:23:58Z: py_spy::python_spy: Found process binary @ 'c:\foo\bar\Python26\python.exe'
INFO 2018-09-19T15:23:58Z: py_spy::python_spy: Got virtual memory maps from pid 4888:
INFO 2018-09-19T15:23:58Z: py_spy::python_spy: map: 000000001d000000-000000001d00b000 rwx c:\foo\bar.moved\Python26\python.exe
INFO 2018-09-19T15:23:58Z: py_spy::python_spy: map: 0000000077190000-000000007733a000 rwx C:\Windows\SYSTEM32\ntdll.dll
INFO 2018-09-19T15:23:58Z: py_spy::python_spy: map: 0000000076f70000-000000007708f000 rwx C:\Windows\system32\kernel32.dll
INFO 2018-09-19T15:23:58Z: py_spy::python_spy: map: 000007fefd250000-000007fefd2ba000 rwx C:\Windows\system32\KERNELBASE.dll
INFO 2018-09-19T15:23:58Z: py_spy::python_spy: map: 000007fefced0000-000007fefcf50000 rwx C:\Windows\system32\ctiuser.dll
INFO 2018-09-19T15:23:58Z: py_spy::python_spy: map: 000007fefd890000-000007fefd8dd000 rwx C:\Windows\system32\WS2_32.dll
INFO 2018-09-19T15:23:58Z: py_spy::python_spy: map: 000007fefd950000-000007fefd9ef000 rwx C:\Windows\system32\msvcrt.dll
INFO 2018-09-19T15:23:58Z: py_spy::python_spy: map: 000007fefd9f0000-000007fefdb1d000 rwx C:\Windows\system32\RPCRT4.dll
INFO 2018-09-19T15:23:58Z: py_spy::python_spy: map: 000007feff040000-000007feff048000 rwx C:\Windows\system32\NSI.dll
INFO 2018-09-19T15:23:58Z: py_spy::python_spy: map: 0000000077360000-0000000077367000 rwx C:\Windows\system32\PSAPI.DLL
INFO 2018-09-19T15:23:58Z: py_spy::python_spy: map: 000007fefce20000-000007fefce29000 rwx C:\Windows\system32\FLTLIB.DLL
INFO 2018-09-19T15:23:58Z: py_spy::python_spy: map: 0000000077090000-000000007718a000 rwx C:\Windows\system32\USER32.dll
INFO 2018-09-19T15:23:58Z: py_spy::python_spy: map: 000007fefd8e0000-000007fefd947000 rwx C:\Windows\system32\GDI32.dll
INFO 2018-09-19T15:23:58Z: py_spy::python_spy: map: 000007feff030000-000007feff03e000 rwx C:\Windows\system32\LPK.dll
INFO 2018-09-19T15:23:58Z: py_spy::python_spy: map: 000007fefd380000-000007fefd44b000 rwx C:\Windows\system32\USP10.dll
INFO 2018-09-19T15:23:58Z: py_spy::python_spy: map: 000007feff3c0000-000007feff49b000 rwx C:\Windows\system32\ADVAPI32.dll
INFO 2018-09-19T15:23:58Z: py_spy::python_spy: map: 000007fefdfd0000-000007fefdfef000 rwx C:\Windows\SYSTEM32\sechost.dll
INFO 2018-09-19T15:23:58Z: py_spy::python_spy: map: 000000001e000000-000000001e2b4000 rwx c:\foo\bar.moved\Python26\python26.dll
INFO 2018-09-19T15:23:58Z: py_spy::python_spy: map: 000007fefe2a0000-000007feff02a000 rwx C:\Windows\system32\SHELL32.dll
INFO 2018-09-19T15:23:58Z: py_spy::python_spy: map: 000007fefdb20000-000007fefdb91000 rwx C:\Windows\system32\SHLWAPI.dll
INFO 2018-09-19T15:23:58Z: py_spy::python_spy: map: 0000000072d90000-0000000072e33000 rwx C:\Windows\WinSxS\amd64_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.6161_none
VCR90.dll
INFO 2018-09-19T15:23:58Z: py_spy::python_spy: map: 000007fefdba0000-000007fefdbce000 rwx C:\Windows\system32\IMM32.DLL
INFO 2018-09-19T15:23:58Z: py_spy::python_spy: map: 000007feff210000-000007feff319000 rwx C:\Windows\system32\MSCTF.dll
Error: Couldn't find binary in virtual memory maps

c:\foo\bar.moved\Python26>

Change flame-graph default duration when starting a process

This is kind of related to #21, but not exactly the same.

It would also be helpful if when launching py-spy to start a Python process, the default behaviour would be to run the flame-graph until the process terminated. Currently I am running:
py-spy --flame profile.svg --duration=10000 -- python myprogram.py

Allowing a duration option of -1 for this behaviour would also fix the issue. I've never written Rust, but I could probably figure out how to do this myself, but not to support the referenced issue above.

Stance on understanding Python frameworks?

How do you feel about py-spy having an understanding of some common Python frameworks? We have a fairly large Django project, and I wanted to experiment with being able to do things like, "Generate a flamegraph of this one particular view as it's invoked on a gunicorn worker in prod, and filter out all the other stuff." or "How much time are we spending in middleware processing?"

Does this sound like something that might one day be accepted as a pull request into this project, or do you feel it's inappropriate for the scope of py-spy? If it does sound like something that belongs in this project, can you give any pointers on how I should write things to increase the odds of it being accepted? I code Python for a living, but I'm very new to Rust.

Having been on the other side of this conversation many times, I realize that plugin interfaces can be tricky to nail down, so I'm perfectly happy with, "I haven't had time to think about it yet." I just wanted to check in before I started hacking around on it.

Thanks for making this great project!

Error while trying to run in Kubernetes

I got this error while trying to profile in a pod in Kubernetes

root@pomegranate-deployment-6844867c8c-49mtx:/app# py-spy --pid 13
Permission Denied: Try running again with elevated permissions by going 'sudo env "PATH=$PATH" !!'

I suspect it needs some kernel capability that is filtered out by default. Any idea which ones does it need?

How are race conditions avoided

I still have no knowledge of Rust so I might have missed something, so apologies for that if this turns out to be a silly question. As far as I understand the code relative to Linux, the target process memory is read on-demand rather than in just one call to process_vm_readv. Since the target process is not stopped, how are race conditions avoided when unwinding the interpreter state? Can it not happen that, while the profiler is navigating the list of frames, this is suddenly invalidated by, e.g., the associated thread dying?

py-spy on host unable to trace python process running in container

From the host, I tried to trace a python process running in a docker container. It failed with the following error.

# py-spy --pid 3676
Error: No such file or directory (os error 2)

strace shows it dies at open("/usr/local/bin/python2.7", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory). I see that it got that path via readlink("/proc/3676/exe", "/usr/local/bin/python2.7", 256) = 24

python2.7 is only available at that path in the container's mount namespace. From outside the namespace it's in one of the filesystems mounted under /var/lib/docker.

OS cannot find binary when installed in a pyenv-managed virtualenv

I am working on an EC2 instance using a version of pyenv compiled from the github repo.

When I pip install py-spy, everything looks fine, but when I run py-spy --pid xxxx, it fails to find the binary.

I assumed this was a python package so I ran python -c "import sys; print(sys.path)" to verify my system path to see where py-spy should be if I were loading it into a interpreter and py-spy is nowhere to be found on any of those paths which are:

['',
 '{HOME}/.pyenv/versions/3.6.3/lib/python36.zip',
 '{HOME}/.pyenv/versions/3.6.3/lib/python3.6',
 '{HOME}/.pyenv/versions/3.6.3/lib/python3.6/lib-dynload',
 '{HOME}/.pyenv/versions/{my_virtual_env}/lib/python3.6/site-packages']

I also looked in:

{HOME}/.pyenv/shims/

and had no luck. Instead it's located here:

 {HOME}/.pyenv/versions/3.6.3/envs/{my_virtual_env}/bin/py-spy

Is this the intended behavior? Did I mess something up? Or should this be placed on the .pyenv/shims/* path?

I'm obviously using python 3.6.3 and working on Linux AMI.

If it helps, pyenv was installed from the Github repo not Homebrew. Also, this worked on my mac which is running the pyenv homebrew version and py-spy installed to:

{HOME}/.pyenv/shims/py-spy

Show thread names in --dump

Python threads have names:

>>> import threading
>>> threading.current_thread().name
'MainThread'

It would be very nice if py-spy --dump could print those names.

add config file

It would be pretty great to have a persistent config file, with the main initial use case being the ability to exclude certain functions (mark them as idle for the purposes of sampling).

Customisation of flame-graph parameters

The default setting to make the flame-graph are pretty good, but it would be nice to be able to flex them. Things I'd like to be able to do:

  • Adjust the size of the output svg
  • Remove some layers of the call stack from the output (see the attached svg for pytest on a simple python test)
  • Use different colour schemes
  • List absolute time instead of number of samples

I can think of three ways to do this:

  1. Expose the output of the profiler before it goes into flame, a custom call to the flame-script could then be executed by the user
  2. Allow a dictionary of command line arguments to be given to py-spy and passed on
  3. Pass a command-line config file

I have not used Rust before, but I could perhaps implement this change given some direction. FWIW I think the second is probably the best option, even if it is a little hacky.

pytest_flame

prebuilt binaries need glibc 2.18

Hi,

The prebuilt binaries need glibc 2.18 and EL7 family have 2.17

py-spy: /lib64/libc.so.6: version `GLIBC_2.18' not found (required by py-spy)

Best regards,

build fails with rust < 1.26

on ubuntu 18.04 64bit:

$ sudo apt install cargo
...
The following NEW packages will be installed:
  cargo libgit2-26 libhttp-parser2.7.1 libstd-rust-1.25 libstd-rust-dev
  rust-gdb rustc
...

$ cargo install py-spy
    Updating registry `https://github.com/rust-lang/crates.io-index`
 Downloading py-spy v0.1.4                                                      
  Installing py-spy v0.1.4                                                      
 Downloading regex v1.0.5
 Downloading tempfile v3.0.3                                                    
 Downloading failure v0.1.2                                                     
 Downloading lazy_static v1.1.0                                                 
 Downloading clap v2.32.0                                                       
 Downloading proc-maps v0.1.4                                                   
 Downloading indicatif v0.9.0                                                   
 Downloading libc v0.2.43                                                       
 Downloading log v0.4.5                                                         
 Downloading goblin v0.0.15                                                     
 Downloading console v0.6.1                                                     
 Downloading env_logger v0.5.13                                                 
 Downloading tempdir v0.3.7                                                     
 Downloading benfred-read-process-memory v0.1.3                                 
 Downloading utf8-ranges v1.0.1                                                 
 Downloading memchr v2.0.2                                                      
 Downloading aho-corasick v0.6.8                                                
 Downloading thread_local v0.3.6                                                
 Downloading regex-syntax v0.6.2                                                
 Downloading version_check v0.1.4                                               
 Downloading ucd-util v0.1.1                                                    
 Downloading rand v0.5.5                                                        
 Downloading remove_dir_all v0.5.1                                              
 Downloading rand_core v0.2.1                                                   
 Downloading failure_derive v0.1.2                                              
 Downloading backtrace v0.3.9                                                   
 Downloading syn v0.14.9                                                        
 Downloading synstructure v0.9.0                                                
 Downloading quote v0.6.8                                                       
 Downloading proc-macro2 v0.4.18                                                
 Downloading unicode-xid v0.1.0                                                 
 Downloading rustc-demangle v0.1.9                                              
 Downloading cfg-if v0.1.5                                                      
 Downloading atty v0.2.11                                                       
 Downloading bitflags v1.0.4                                                    
 Downloading unicode-width v0.1.5                                               
 Downloading textwrap v0.10.0                                                   
 Downloading strsim v0.7.0                                                      
 Downloading vec_map v0.8.1                                                     
 Downloading lazy_static v0.2.11                                                
 Downloading parking_lot v0.6.4                                                 
 Downloading regex v0.2.11                                                      
 Downloading lock_api v0.1.3                                                    
 Downloading parking_lot_core v0.3.0                                            
 Downloading owning_ref v0.3.3                                                  
 Downloading scopeguard v0.3.3                                                  
 Downloading stable_deref_trait v1.1.1                                          
 Downloading smallvec v0.6.5                                                    
 Downloading unreachable v1.0.0                                                 
 Downloading void v1.0.2                                                        
 Downloading clicolors-control v0.2.0                                           
 Downloading regex-syntax v0.5.6                                                
 Downloading scroll v0.9.0                                                      
 Downloading plain v0.2.3                                                       
 Downloading scroll_derive v0.9.4                                               
 Downloading termcolor v1.0.3                                                   
 Downloading humantime v1.1.1                                                   
 Downloading quick-error v1.2.2                                                 
 Downloading rand v0.4.3                                                        
 Downloading log v0.3.9                                                         
 Downloading termios v0.2.2                                                     
 Downloading backtrace-sys v0.1.24                                              
 Downloading cc v1.0.23                                                         
 Downloading ansi_term v0.11.0                                                  
   Compiling regex v1.0.5                                                       
   Compiling stable_deref_trait v1.1.1
   Compiling rustc-demangle v0.1.9
   Compiling ansi_term v0.11.0
   Compiling scopeguard v0.3.3
   Compiling failure_derive v0.1.2
   Compiling ucd-util v0.1.1
   Compiling plain v0.2.3
   Compiling unicode-width v0.1.5
   Compiling bitflags v1.0.4
   Compiling remove_dir_all v0.5.1
   Compiling vec_map v0.8.1
   Compiling rand_core v0.2.1
   Compiling regex v0.2.11
   Compiling cc v1.0.23
   Compiling quick-error v1.2.2
   Compiling cfg-if v0.1.5
   Compiling strsim v0.7.0
   Compiling lazy_static v0.2.11
   Compiling version_check v0.1.4
   Compiling termcolor v1.0.3
   Compiling utf8-ranges v1.0.1
   Compiling libc v0.2.43
   Compiling unicode-xid v0.1.0
   Compiling void v1.0.2
   Compiling proc-macro2 v0.4.18
   Compiling owning_ref v0.3.3
   Compiling textwrap v0.10.0
   Compiling regex-syntax v0.6.2
   Compiling regex-syntax v0.5.6
   Compiling humantime v1.1.1
   Compiling log v0.4.5
   Compiling lazy_static v1.1.0
   Compiling atty v0.2.11
   Compiling rand v0.4.3
   Compiling clicolors-control v0.2.0
   Compiling memchr v2.0.2
   Compiling termios v0.2.2
   Compiling rand v0.5.5
   Compiling unreachable v1.0.0
   Compiling lock_api v0.1.3
   Compiling backtrace-sys v0.1.24
   Compiling log v0.3.9
   Compiling clap v2.32.0
   Compiling aho-corasick v0.6.8
   Compiling tempdir v0.3.7
   Compiling tempfile v3.0.3
   Compiling smallvec v0.6.5
   Compiling benfred-read-process-memory v0.1.3
   Compiling parking_lot_core v0.3.0
error[E0658]: use of unstable library feature 'thread_local_state': state querying was recently added (see issue #27716)
   --> /home/tw/.cargo/registry/src/github.com-1ecc6299db9ec823/parking_lot_core-0.3.0/src/parking_lot.rs:169:34
    |
169 |     if let Ok(tls) = THREAD_DATA.try_with(|x| x as *const ThreadData) {
    |                                  ^^^^^^^^

error[E0658]: use of unstable library feature 'thread_local_state': state querying was recently added (see issue #27716)
  --> /home/tw/.cargo/registry/src/github.com-1ecc6299db9ec823/parking_lot_core-0.3.0/src/word_lock.rs:55:38
   |
55 |         if let Ok(tls) = THREAD_DATA.try_with(|x| x as *const ThreadData) {
   |                                      ^^^^^^^^

error: aborting due to 2 previous errors

error: Could not compile `parking_lot_core`.
warning: build failed, waiting for other jobs to finish...
error: failed to compile `py-spy v0.1.4`, intermediate artifacts can be found at `/tmp/cargo-install.SRMdEsZH4KOK`

Caused by:
  build failed

Support pyinstaller binaries

At the moment if you try to run py-spy on a binary created by py-installer you get

Error: Failed to find python version from target process

A trivial fix would be to allow the user to specify the version in case it cannot be detected.
Not entirely sure if the rest would work..

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.