iovisor / bcc

BCC - Tools for BPF-based Linux IO analysis, networking, monitoring, and more
Apache License 2.0
20.56k stars 3.88k forks source link

The pythonstat script doesn't detect/support embedded python interpreters #1580

Open stefreak opened 6 years ago

stefreak commented 6 years ago

A popular way to run python web server apps is by using uwsgi. The python interpreter then does not run as a dedicated process but is embedded into uwsgi. It would be nice if the python* scripts in bcc-tools could be extended to support embedded python interpreters.

palmtenor commented 6 years ago

Ideally, libpython (which is what we need to look for) could export some kind of note / symbol for its existence (maybe version as well), so that when it's statically linked into binaries, we could easily discover it.

@ambv, do you feel this is possible, or there are alraedy something exist for such purpose?

stefreak commented 6 years ago

Indeed it seems to be statically linked, didn't realize that before, so maybe it's enough to add an option to specify the interpreter binary, where one could then pass e.g. /usr/bin/uwsgi_python35