Generate flamegraphs for python processes. This is great for performance profiling.
Note: You need root privs for this to work. In docker you need the container to run with
privileged=true
Live view:
py-spy top --pid 1
Create a flamegraph:
py-spy record -o profile.svg --pid 1