A debugging tool that traces Python function calls in real-time, similar to strace for Python programs.
lptrace is a debugging utility that attaches to running Python processes to trace function calls in real-time, similar to strace but for Python code. It works by injecting code via gdb to hook into the Python interpreter's trace functionality, allowing developers to see exactly what functions are being executed without stopping the program. It is particularly useful for diagnosing issues in production environments where restarting the process is not feasible.
Python developers and system administrators who need to debug live, production Python applications without interrupting service, especially those troubleshooting performance issues, deadlocks, or unexpected behavior in deployed code.
Developers choose lptrace because it provides real-time visibility into Python function execution with minimal dependencies—requiring only Python 2.7.x and GDB 7.x—and no installation on the target process. Its unique ability to optionally inject a pdb debugger prompt for interactive debugging sets it apart from simple logging or static analysis tools.
Trace any Python program, anywhere!
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Displays Python function calls as they happen, similar to strace, allowing immediate insight into program flow without stopping execution, as shown in the SimpleHTTPServer example tracing request handling.
Designed to attach to live processes without restarting, ideal for troubleshooting in production where downtime isn't feasible, as emphasized in the description and usage examples.
Can inject a pdb debugger prompt into the traced program for interactive debugging, provided it has stdin access, offering hands-on issue diagnosis beyond passive tracing.
Requires only Python 2.7.x and GDB 7.x with no additional installation on the target process, making it easy to deploy in various environments without pre-configuration.
Limited to Python 2.7.x, making it unsuitable for modern Python 3 projects, which is a significant restriction given Python 2's end-of-life and lack of updates.
The README explicitly warns about security issues, such as race conditions with temporary files, which could pose risks in production or sensitive environments.
Requires sudo privileges to attach via gdb, limiting use in environments where root access is not granted or is undesirable for debugging purposes.
Focuses only on function call traces without providing details on arguments, return values, or line-by-line execution, which might be insufficient for complex debugging scenarios.