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

Processes not recognized as Python as Rasberry pi #227

Open
bfialkoff opened this issue Jul 17, 2024 · 7 comments
Open

Processes not recognized as Python as Rasberry pi #227

bfialkoff opened this issue Jul 17, 2024 · 7 comments

Comments

@bfialkoff
Copy link

bfialkoff commented Jul 17, 2024

Description

I have a very simple script that for some reason isn't recognized as a python process. It seems that Austin doesn't recognise anything python on the raspberry pi. Below is a minimal example

Steps to Reproduce

from time import sleep
import os

os.system("sudo austin -Cp {} > res.austin &"format(os.getpid()))

def f2():
    print('going to sleep')
    sleep(0.1)
    print('waking up')
def f1():
    f2()

if __name__ == '__main__':
    print('start')
    for _ in range(10):
        f1()
    print('end')

Expected behavior:
Should have a res.austin profile

Actual behavior:
When I run on MacOS everything works as expected however when porting to raspberry pi. Austin says:

👾 It looks like you are trying to profile a process that is not a Python
process. Make sure that you are targeting the right application. If the Python
process is actually a child of the target process then use the -C option to
discover it automatically.

Reproduces how often:
always works on mac never works on the pi.

Versions

running python 3.7 and austin 3.6.0
of the OS you're running.

Additional Information

The issue that seems most related is here
My production code runs on a raspberry pi and is connected to hardware and sensors that i cant fully simulate in my dev environment so i is critical for me to be able to profile directly on device.

The python version is the python the raspberry pi ships with, and i built austin from source.

Help and advice much appreciated.

@P403n1x87
Copy link
Owner

@bfialkoff please note that Austin 3.6 supports CPython 3.8 and above. If you want to use Austin with CPython 3.7 you will have to use version 3.5 instead. Could you try with that version, please? Let me know if that still doesn't work for you.

@bfialkoff
Copy link
Author

I will try, and keep you posted next week. Thanks!

@bfialkoff
Copy link
Author

I upgraded and installed python 3.11.5 from source on the raspberry pi and i am still getting the same message.

👾 It looks like you are trying to profile a process that is not a Python
process. Make sure that you are targeting the right application. If the Python
process is actually a child of the target process then use the -C option to
discover it automatically.

@P403n1x87
Copy link
Owner

@bfialkoff thanks for checking. Does the same happen if you run

from time import sleep
import os

def f2():
    print('going to sleep')
    sleep(0.1)
    print('waking up')
def f1():
    f2()

if __name__ == '__main__':
    print('start')
    for _ in range(10):
        f1()
    print('end')

with austin -o res.austin python script.py?

@bfialkoff
Copy link
Author

bfialkoff commented Aug 1, 2024

Thank for the reply! Yes the same happens, still thinks its not a python process

@bfialkoff
Copy link
Author

Checking in, do you have any advice for me?
Anything I can do to get this working?
Or else alternate tools that i might be able to use. the critical feature here is the profiling of subsequent spawned process etc, i found cProfile, py-spy, pyisntrument didn't give me the insight i need.

@P403n1x87
Copy link
Owner

@bfialkoff I haven't had the chance to look into this. You could try with echion, although I have not tested it on the RPi. It should provide similar functionality to Austin 🤞

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants