前言

本片文章主要总结了一下关于Vtune Amplifier的命令行的基本使用,针对性的比较复杂的使用方法本篇文章没有给出,请参考intel官方文档。

Amplxe-cl命令格式

amplxe-cl <action> [action-option] [global-option] [[--] <target> [target-options]]

Amplxe-cl常用分析流程

鉴于是我个人的使用的总结,我只把我使用的流程写上,没用过的就不妄自揣度了。

收集性能数据

命令一般使用amplxe-cl -collect,分析类型的信息可以用 amplxe-cl -help collect <analysis_type>命令查看。对于不同收集类型的配置信息用amplxe-cl -knob-list <analysis_type>查看(PS:knobs就是configuration options)。 如最简单的:

amplxe-cl -collect hotspots -- ./sample

对于远程性能收集命令(远程上需要安装amplxe-cl,并且如果安装目录不是默认目录,命令还需要指定远程系统的安装目录参数):

amplxe-cl --target-system=ssh:user@host -collect hotspots -- /target_path/app

结果自动保存在当前目录下的r000hs/里。

Xeon Phi上的性能数据收集

正常安装完工具和工具附带的驱动(具体详见《使用VTune™ Amplifier XE 2013工作在Intel® Xeon Phi™ coprocessor的一般步骤》)。 注意:如果需要用到代码的分析时,编译指令需要指定-g参数并且优化使用-O2或者不使用优化。

下面是收集性能数据的命令: Offload的例子:

amplxe-cl -collect knc-lightweight-hotspots -- ./sample 

native的例子(设定搜索路径,运行时间):

amplxe-cl -collect knc-lightweight-hotspots -search-dir all=./ -d 20 -- ssh mic0 /target_path/app

万一在采样时没加搜索路径,可以事后补救, 如:

amplxe-cl -finalize --search-dir all:rp=./ -r r002lh/

或者用命令(这种方式貌似配置起来有点不一样,出问题了Google吧~):

amplxe-cl --target-system=mic-native -collect knc-lightweight-hotspots -- /target_path/app

还有一种是直接使用选中的Events即是用collect-with的:

amplxe-cl -collect-with runsa-knc -knob event-config=CPU_CLK_UNHALTED,INSTRUCTIONS_EXECUTED -search-dir all=./ -d 20 -- ssh mic0 /target_path/app

所支持的Events可以从vtune_amplifier_xe的安装目录下的/lib64/knc_db.txt中找到。

注意:用ssh方式运行时目标程序运行的默认当前目录是ssh所登陆用户的主目录。

分析性能数据

  1. 命令一般是使用amplxe-cl -report,命令需要一个分析类型的参数,可以参照以上介绍查看命令帮助。 对于以上收集的性能数据可以用:
    amplxe-cl -report hotspots -r r000hs
    
  2. 结果也可以用图形界面分析的,把结果拷贝到本地,用amplxe-gui打开性能数据进行图形化分析。
  3. 分析性能的解读请参考:

参考

使用VTune™ Amplifier XE 2013工作在Intel® Xeon Phi™ coprocessor的一般步骤 Intel® VTune™ Amplifier 2013 help Intel VTune Amplifier 更多参考请见Intel VTune Amplifier软件帮助!