Systemtap with Python

107 Views Asked by At

Is there a way to probe python3 user space functions with Systemtap on Ubuntu? I'm thinking about doing something like this based on the Systemtap documentation

probe process("/usr/lib/python3").function("main")
{
    some handlers
}

When I run stap with the file above, I got

WARNING: cannot find module /mnt/sdb/usr/bin/python3.6 debuginfo: No DWARF information found [man warning::debuginfo]

Am I missing anything here and is this the right way to trace Python applications?

1

There are 1 best solutions below

0
fche On

This should work, but does need some python debuginfo. If you have debuginfod capability in your build of elfutils/systemtap, setenv DEBUGINFOD_URLS=https://debuginfod.elfutils.org/ and try again. If you don't, consider downloading and installing the appropriate dbgsym from http://ddebs.ubuntu.com/ubuntu/pool/main/p/python3.5/ (probably).