我尝试分析我的 CherryPy Web 服务器,结果我有一些 .prof
文件。我可以使用 this post 中描述的网络浏览器以文本格式阅读它们。 。但我需要将结果导出到调用树中以使用 KCacheGrind 或 Gprof2Dot 等进行分析。
但是 Gprof2Dot 给了我一个错误:
profile_results>gprof2dot.py -f prof out.prof | dot -Tpng -o out.png
error: unexpected end of file
KCacheGrind 不知道 .prof
文件...
有什么方法可以以图形格式获取调用树吗?
谢谢。
最佳答案
您需要使用 pstats。
gprof2dot -f pstats out.prof | dot -Tpng -o out.png
CherryPy 使用 python cProfile/profile。
关于python - 分析 CherryPy : convert results to graphic format,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22961681/