Skip to content

xerebz/phatstacks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

phatstacks

A few useful scripts for debugging Python performance on running processes. No code instrumentation required.

Prerequisites

Depends on pyrasite.

pip install pyrasite

..which depends on gdb.

sudo apt install gdb

On Ubuntu, you'll also need to enable ptrace.

echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope

The user running the process needs read access to these scripts.

Usage

Write the stacktrace of a running program to $HOME/stacktrace-PID.log

pyrasite PID /path/to/phatstacks.py

Start profiling a running program

pyrasite PID /path/to/profstart.py

End profiling and write cProfile output to $HOME/profile-PID.cprof

pyrasite PID /path/to/profend.py

View profiling output using RunSnakeRun or pstats

python -m pstats $HOME/profile-PID.cprof

About

No-fuss Python performance debugging

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages