intel vtune的安装与使用

来源:互联网 发布:29岁电工自学编程行骗 编辑:程序博客网 时间:2024/06/08 18:58

太久没写博客了,赶在月末随便写点东西,最近在琢磨intel的vtune,就把自己的使用过程记录下来吧。

因特尔Vtune是一个比较强大的性能分析器(但是可能是可能本人功力太弱,在使用过程中实在是发挥不出它的优势啊…………)


安装版本:vtune_amplifier_xe_2013_update17

平台:ubuntu(版本不记得了)。



1、vtune_amplifier_xe_2013_update17.tar.gz拷贝到linux的用户目录下

2、解压到当前目录:

      > tar–zxvf vtune_amplifier_xe_2013_update17.tar.gz

3、安装:

      > cd vtune_amplifier_xe_2013_update17/

      > ./install.sh

      我实用SSH远程操作的,如果你在linux系统的终端进行操作可用./install_GUI.sh

安装过程中除了协议那里输入“accept”,之后输入license之外,基本一路按Enter,如果你选择自定义安装,那就另当别论了,但是一定要记住你的安装路径哦。

4、还需要source一下:

      > Source <install_dir>vtune_amplifier_****/amplxe-vars.sh

      比如我的这个版本又是默认安装路径的话就是:

      > Source/opt/intel/vtune/vtune_amplifier_xe_2013/amplxe-vars.sh

      哦,对了,我实在root用户下安装的,如果你的不是在root下,那就按自己的路径来。


安装完成之后就是使用了,如果在linux系统的终端可以用> amplxe-gui 进入图形操作界面,在图像操作界面除了查看分析结果的物理意义外(这里很多参数真的看不懂啊……),在操作上应该没有太大的问题,下面讲讲用command line进行收集和分析:


amplxe-cl语法:

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

such as:

$amplxe-cl -collect hotspots -result-dir r001hs –quiet home/test/sample

where:

  • -collect is an action
  • hotspots 是action的参数
  • -result-dir is an action-option(就是自定义结果保存路径)
  • r001hs是action-option的参数
  • sample 你要分析的目标
  • -quiet is a global-option
如果没有指定目录的话结果就自动保存在当前路径,形式是<r@@@{at}>
  • @@@ 当前这种分析类型下是从000开始的自增数
  • {at} 是当前这种分析类型的简写,比如hs就是hotspots,cc是Concurrency, lw是LocksandWaits
学会查看帮助:

1)> .amplxe-cl –help

2)> .amplxe-cl -help <action>.

Where <action> is one of all available actions. such as:

amplxe-cl –help collect

amplxe-cl –help collect hotspots

3).Amplxe-cl <–action>-list.

See all the list of this action's argument. such as:

amplxe-cl –collect-list

数据收集:

amplxe-cl -collect hotspots-result-dir r0001hs -- ./gsexample2a datafile.txt

amplxe-cl -collect concurrency -r r0002cc -search-dir all:rp=/home/ompPrimes --./ompPrime1.icc

amplxe-cl -collect locksandwaits -user-data-dir /tmp -r r0003lw --./ompPrime1.icc

amplxe-cl -collect lightweight-hotspots -r r0004lh -- ./primes.gcc

数据分析:

amplxe-cl -report hotspots -result-dir r001hs -group-by function -filter module=gsexample2a ; 仅列出模块gsexample2a相关的热点函数

amplxe-cl -report hotspots -result-dir r001hs -call-stack-mode=all-group-by function; 列出所有的热点函数,包含链接库的

amplxe-cl -report summary-user-data-dir /tmp -r r0003lw; 仅显示summary的结果

amplxe-cl -report hw-events-r r007ma -group-by process


注:使用过程中的一个问题:

此处遇到一个问题,和sampling driver相关的问题,导致基于硬件的分析无法进行,显示查看“Building and Managing the Sampling Driver”help topic,自己的vtune安装目录里的documentation/en/help/index.htm,点击左上角的“search”,输入查找,可以找到帮助文档。

具体解决过程如下:

On linux* os:

注:VTuneAmplifier XE的默认安装路径是:opt/intel/vtune_amplifier_xe_<version>.

(VTune Amplifier for Systems默认安装路径是:/opt/intel/system_studio_<version>/vtune_amplifier_<version>_for_systems.

进入路径<install_dir>/sepdk/src

1、     检查驱动是否已经安装:

./insmod-sep3 –q     /*-q is short for –query*/

2、     如果驱动正确加载,核对当前用户是否在权限组里,否则申请加入;

如果内核缺失:./build-driver -ni--install-dir=../src

3、     如果安装失败,请检查内核环境;

如果安装成功,reload:./insmod-sep3 -r -g <group>

4、     启动时自动加载驱动:

./boot-script --install -g <group>

If to build the driver with the per-user event-based sampling collection on,use the -pu (-per-user) option:

安装:./build-driver-ni -pu --install-dir=../src

重加载:./insmod-sep3-r –pu

设置启动:./boot-script--install –pu

0 0