-
Notifications
You must be signed in to change notification settings - Fork 440
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
Can't profile pyinstaller binaries on OSX #207
Comments
Maybe relevant: borg uses pyinstaller for it's binary distribution. |
Profiling pyinstaller bundled python distributions was failing on OSX, if the python binary was built with --enable-framework. Tweak the check for python frameworks on OSX to include things that aren't installed to a normal location (#207)
This is related to pyinstaller on osx, specifically with pyinstaller bundling python built with the --enable-framework flag (linux was already working fine w/ #42). The last commit should fix, will be in the next release. The weird thing is that it took 15 minutes to fail. It should fail nearly instantly if it fails to find the python interpreter - and thats exactly what happened when I tried profiling borg with py-spy just now. Does a progress bar display during this 15 minutes ? Is py-spy using CPU ? Does it take exactly 15 minutes - can you run this with 'sudo time py-spy record -o OUTPUT.svg -d 900 -p 41144' to see how long its taking? |
@benfred no progress bar nor anything else but the message Just ran it again, once more on a
So it took 1310/60 =~ 21.8 ie almost 22 minutes this time around. BTW, I tried bringing up a rust cross-compile environment so I could build your latest master (with the commit) on my development Linux notebook and have it run on the production MacOSX server (I know this sounds strange in a "the-other-way-around" manner, but it's just as things are here), to no avail: I kept getting weird errors from rustup, and had to give up when I burned through the time I had available to make it happen. If you can, please let me know when a new |
@DurvalMenezes That's bizarre, I really can't see why it's taking that long. I'm pretty confident that the last release will fix the error, but I'm worried that even with the fix we still might have that 20+ minute lag. Can you enable logging and paste the output? (```RUST_LOG=info py-spy record -o ...) I've uploaded a binary that you you can test out the fix with. You can download/install on your mac with:
If you don't have pip installed you can just |
@benfred many thanks for the prepared binary, and for the thoughtful, detailed comment. More, below:
Just did it, see below.
No
Just ran it as you requested, again on the running
The initial "Sampling process" message showed up almost immediately, followed by the weird control symbol "progress bar" and a counter that advanced all the way to 90000/90000. To my dismay, I can't find the Anyway, it seems to be working now -- and without the initial 22-min lapse. The previous version still produces it before erroring out, so if you want a RUST_LOG output from it please let me know the exact command line (or the place where the produced file would be). If it would help, I can also run it under To sum it up. Let me know how I can help and I will be glad to. |
I think its weird that almost all of that 22 minutes is spent in syscalls rather than user code - and I'm wondering if the 22 minute initial lapse is related to the performance problem that you are trying to debug. Is the system otherwise pretty responsive during these problems, or is it painfully slow to do other basic operations? Enabling logging would be done by |
that fix is in v0.3.2 |
Getting an error here when I try to profile a running
borg create
(from borg backup) command:py-spy
then spends the next 900s doing something (hopefully sampling the process) and then fails with the messageError: Failed to find python version from target process
.This happens when running the standard borg "binary" from the
borg backup
distribution, which 'encapsulates' everything needed for borg to run inside that binary, including the Python executable.Using
lsof
, I'm able to determine the location of the Python interpreter binary, which in the above case was/private/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/_MEIkCvo55/Python
; I suspect that path would change from one run to the other, but anyway I'm able to determine it before callingpy-spy
.How can I proceed towards specifying this path to
py-spy
? I really need it in order to debug some really weird behavior we're seeing withborg backup
.Thanks in advance,
-- Durval.
The text was updated successfully, but these errors were encountered: