使用py-spy查看python程序调用堆栈 安装py-spy pip install py-spy top查看python pid top 查看代码堆栈 py-spy top --pid 1780 时间会记录下一切。