【发布时间】:2015-09-15 13:06:49
【问题描述】:
Kcachegrind 是一个出色的实用程序,可以在分析代码时将热点直观地表示到源代码行级别。我发现它在微优化我的 C++ 代码库时非常有用。 对于我最新的 python 项目,我开始使用 Kcachegrind 处理来自profilestats 的输出。 Kcachegrind 是一个仅限 linux 的实用程序,但有各种非官方端口可用,我正在使用的是 qcachegrind。 一般来说,它在很大程度上适用于大多数问题,除了我很难让源注释工作。
在源选项卡上,我收到了熟悉的源缺失消息
There is no source available for the following function:
'main C:\Projects\module\src\source.py:397'
This is because no debug information is present
Recompile source and redo the profile run.
The function is located in the ELF Object:
'(unknown)'
使用选项
Settings -> Configure -> Source Annotation
并且添加源基本目录没有用。
我感觉该实用程序需要一个与 Python 无关的 ELF 对象。在这方面的任何帮助都会很有用。
相关信息:
- Python 2.7
- profilestats (2.0)
- QCachegrind 0.7.4
- Windows 2012R2
【问题讨论】:
-
似乎
profilestats可能未在其输出中包含相关数据。您是否尝试过将分析输出保存为“Python 格式”并使用pyprof2calltree进行转换?
标签: python python-2.7 profiling kcachegrind profilestats