Comments (9)
What operating system are you on? I managed to replicate this on OSX, but want to make sure I'm targeting the right platform. Also can you enable logging and paste the output here (export RUST_LOG=info
on osx/linux or set RUST_LOG=info
on windows cmd.exe then run the command again).
I don't think the rest would work even if we passed the version in - py-spy is failing to find the right libpython binary, so even with the right version it would fail to find the python interpreter.
On OSX pyinstaller is bundling the libpython to something like
INFO 2018-09-21T19:26:51Z: py_spy::python_spy: map: 0000000100c1c000-0000000100d11000 r-x /Users/ben/code/py-spy/test_programs/dist/test/Python
and we are expecting something like 'libpython' or 'Python.Framework/.../Python'. I'm not sure what this is like on other systems =(.
from py-spy.
I'm on debian/centos. Would you mind making a release that allows you to specify the version and the offset for the PyInterpreterState
(or something that is useful)? then I could play with this trying to figure out how to get this address out of the static binary in a nice way
from py-spy.
I tested py-spy with pyinstaller on centos7, and found two different minor issues.
- python runs in a subprocess of the pyinstaller executable
It looks like the pyinstaller process forks, and loads up python in the subprocess (while the main process waits for the subprocess to finish). This means that you can't go 'py-spy -- path/to/executable' and have to instead go 'py-spy --pid <pid_of_subprocess>'. Eventually I'd like for py-spy to inspect subprocesses too (to help with multiprocessing etc), but for now you'll have to specify the pid
Note: pyinstaller on OSX doesn't seem to fork like this 🤷♂️
- py-spy isn't finding the libpython binary
This is what's preventing py-spy from getting the version string for you =(.
The problem is that libpython is something like /home/vagrant/dist/test/libpython2.7.so.1.0
or /tmp/_MEIOqzg01/libpython2.7.so.1.0
(depending on whether you're creating a single file or single directory pyinstaller).
we are expecting libpython to be in lib/ or lib64, matching like :
Lines 409 to 410 in 9823477
which isn't the case for pyinstaller here =(
The good news is that is pretty easy to fix, and I'll have a fix for this in the next version (either later today or on sunday).
from py-spy.
This commit should fix the failing to find libpython problem with pyinstaller: 064b8e7
This will be in the next release. Note that you still will need to pass the pid of the python subprocess for now.
from py-spy.
fixed in v0.1.8
from py-spy.
Working great! Thank you
from py-spy.
When doing this I see 3 processes functions taking 100% of the time - it doesn't really make any sense to count these in and they make the flamegraph weird
Can you add them to the blacklist ? Should I open another issue?
from py-spy.
hmm - marking these as idle seems unideal too though (would show process not being busy, when it's busy in subprocessess). I'm going to add an issue for a config file where you can specify custom functions to exclude.
Also I think eventually it would be good to also sample from subprocesses
from py-spy.
from py-spy.
Related Issues (20)
- Elf sbss issue HOT 1
- Option to get native thread ID with best effort HOT 2
- Encounter os error 31 with py-spy record
- Python 3.12 support HOT 10
- Python 3.11 --native profiling fails because of bpo-45256 HOT 1
- Seg fault on py-spy record --subprocesses
- Test `--native` option in CI
- redirect to stdoutput
- py_spy fails to find interpreter on Windows HOT 4
- Assertion errors when HOT 2
- `--native` HOT 2
- Consider moving CLI functionality behind a feature flag
- attempt to subtract with overflow in console_viewer.rs
- libproc v0.13.0 doesn't build for me
- Programmatically start/stop py-spy recording HOT 1
- Panics at times when sampling a Django app HOT 1
- No source distribution files available in the Pypi site
- Flame graphs cpu on-off
- Add build instruction to README
- Use as python library HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from py-spy.