[英]Using Intel Vtune to profile Application from Qt Creator
I want to profile application from QtCreator using Vtune on Windows 7 . 我想在Windows 7上使用Vtune从QtCreator配置应用程序 。 But Vtune is basicaly made for Visual Studio Apps, so I have to make the link between my function's names and the instruction in release build.
但是Vtune基本上是为Visual Studio应用程序制作的,所以我必须在我的函数名称和发布版本中的指令之间建立链接。 Actually I have only pseudo names func@address in Hotspots ,its not usable.
实际上我在Hotspots中只有伪名称func @ address,它不可用。
By exploring the "Getting Started" from Intel Vtune I find that I must enable the Debug Information in my release build but How to perform that in QtCreator? 通过探索英特尔Vtune的“入门”,我发现我必须在我的发布版本中启用调试信息,但如何在QtCreator中执行该操作?
From 'Using Debug Information' File: 从'使用调试信息'文件:
To provide accurate performance data and enable source analysis, the Intel® VTune™ Amplifier requires debug information for the binary files it analyzes.
为了提供准确的性能数据并启用源分析,英特尔®VTune™放大器需要其分析的二进制文件的调试信息。 If it does not find debug information in the binaries, the VTune Amplifier statically identifies function boundaries and assigns hotspot addresses to generated pseudo names func@address for such functions.
如果它没有在二进制文件中找到调试信息,则VTune Amplifier静态地识别函数边界并将热点地址分配给这些函数的生成的伪名称func @ address。
If debug information is absent, the Call Stack pane may not unwind the call stack correctly for user-mode sampling and tracing analysis types.
如果缺少调试信息,则“调用堆栈”窗格可能无法正确解开调用堆栈以进行用户模式采样和跟踪分析类型。 Additionally in some cases, it can take significantly more time to finalize the results for modules that do not have debug information.
此外,在某些情况下,最终确定没有调试信息的模块的结果可能需要更多时间。
On Windows* operating systems, PDB files provide debug information.
在Windows *操作系统上,PDB文件提供调试信息。 Make sure both your system and application libraries/executable have PDB files.
确保您的系统和应用程序库/可执行文件都有PDB文件。 Compile your target with optimizations and start profiling its performance.
使用优化编译目标并开始分析其性能。
By default, the Microsoft Visual Studio* IDE does not generate PDB information in the Release mode.
默认情况下,Microsoft Visual Studio * IDE不会在发布模式下生成PDB信息。 For better results with the VTune Amplifier, enable symbol generation manually.
为了使用VTune放大器获得更好的结果,请手动启用符号生成。 For system libraries, use the Microsoft* Symbol Server to download the required PDB files from the Microsoft* web site.
对于系统库,请使用Microsoft * Symbol Server从Microsoft *网站下载所需的PDB文件。 Follow the steps below to ensure the VTune Amplifier uses debug information for both system and your own libraries.
按照以下步骤确保VTune Amplifier使用系统和您自己的库的调试信息。
I try some methods like: -edit the file.pro to change the release build 我尝试了一些方法,例如:-edit file.pro来更改发布版本
QMAKE_CXXFLAGS_RELEASE += -g
QMAKE_CFLAGS_RELEASE += -g
QMAKE_LFLAGS_RELEASE =
but it doesn't change anything, i still haven't the function name printed 但它没有改变任何东西,我仍然没有打印功能名称
Any input is much appreciated. 任何输入都非常感谢。
Yes, for VTune (or other similar profiling tools) you need "release build" (ie optimization switched ON) with debug information switched ON as well. 是的,对于VTune(或其他类似的分析工具),您需要“释放构建”(即优化开启),同时调试信息也会打开。 QTCreator doesn't create this kind of release+debug configuration by default.
QTCreator默认情况下不会创建此类发布+调试配置。
For Windows MS compiler toolchain case it implies that you have to supplement Release configuration with additional /Zi compilation and /DEBUG linker options. 对于Windows MS编译器工具链,它意味着您必须使用其他 / Zi编译和/ DEBUG链接器选项来补充 Release配置。
In order to propagate these additional options in QTCreator use following steps (see also screen-shot below): 为了在QTCreator中传播这些附加选项,请使用以下步骤 (另请参见下面的屏幕截图):
QMAKE_CXXFLAGS+=-Zi
QMAKE_LFLAGS+=/DEBUG
QMAKE_CXXFLAGS+=-Zi
QMAKE_LFLAGS+=/DEBUG
Few more minor notes: 几个小调 :
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.