使用amplxe-cl 命令行进行性能数据收集和分析

作者: Peter Wang (Intel) (41 篇文章) 日期: 十一月 10, 2010 在 3:48 下午

Intel® VTune™ Amplifier XE 2011 是新一代的性能分析工具,含图形界面以方便分析结果。但有时我们基于二点原因需要使用命令行来收集性能数据和进行分析:

1.含图形界面的工具自身消耗系统的资源

2.用户需要做自动(回溯)性能收集和分析的工作(Run Script),及产生报告

准备工作:

Windows环境下:Command Prompt > $Amplifier XE 2011\ampxe-vars.bat

Linux环境下:source  $vtune_amplifier_xe/amplxe-vars.sh

命令行句法

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

解释

<action-option> 表示动作的类型,可以是下列之一:collect, collect-list, command, finalize, help, import, knob-list, report, report-list, version。常用的如“-collect” , “-report”, “-collect-list”

[modifier-option] 可以是以下一个或多个选项: allow-multiple-runs, callee-attribution-mode, csv-delimiter, cumulative-threshold-percent, data-limit, [no-]discard-raw-data, quiet, duration, filter, [no-]follow-child,  format, group-by, knob, limit, mrte-mode, report-output, result-dir,  resume-after, search-dir, start-paused, target-duration-type,  target-pid, target-process, user-data-dir, verbose

<target> 表示被分析的应用程序

[target options] 是指应用程序的参数

应用实例

1.列出本机所有支持的分析类型

amplxe-cl –collect-list

amplxe-cl –report-list; 可支持的报告类型

2.输入、分析VTune(TM)Performance Analyzer 的结果

如:amplxe-cl -import tbsf141.tb5 -r r001

如:amplxe-cl -report pmu-events -r r001 -group-by function

3.热点收集

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 -collect nehalem_memory-access -duration 10; 系统热点收集

amplxe-cl -collect lightweight-hotspots -target-process gnome-power-manager -duration 10; 对象应用程序的性能数据收集

【注】如果目标对象是Service Application,建议手工加载程序,然后用Attach-to-process

amplxe-cl -collect concurrency -duration n -target-process program,或

amplxe-cl -collect concurrency -duration n -target-pid pid

特别的,最好使用“detach”去终止它(Duration可以设的长一点)

如:amplxe-cl -command detach -r r003hs

4.热点分析

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

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

4.c amplxe-cl -report perf-detail -r r000hs -cumulative-threshold-percent 80; 列出占处理器时间80%的函数(模块)信息

4.d  amplxe-cl -report perf -csv-delimiter="," -r r000hs; 结果中加入分隔符

5.并行分析

5.a  amplxe-cl -report summary -r r0002cc; 显示汇总信息

5.b  amplxe-cl -report hotspots -r r0002cc -group-by function; 显示热点函数的并行度

5.c amplxe-cl -report hotspots -r r0002cc -format text -limit 1; 输出格式为text, 仅显示 Top 1

5.d amplxe-cl -report hotspots -r r0002cc -call-stack-mode=all -group-by function; 显示所有函数

6.锁和等待分析

6.1 amplxe-cl -report summary -user-data-dir /tmp -r r0003lw; 显示汇总结果

6.2 amplxe-cl -report wait-time -user-data-dir /tmp -r r0003lw -group-by sync-obj;sync objects 的等待分析

7.Lowweight(轻量级)的热点及基于PMU Event分析

amplxe-cl -report hw-events -r r0004lh -group-by function -csv-delimiter=","

8.系统热点分析

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

amplxe-cl -report hw-events -r r007ma -filter module=Xvnc -group-by function

9.目标模块的分析(要求目标模块带调试信息)

amplxe-cl -report hw-events -r r010lh -group-by function -filter module=gnome-power-manager

另:

1. 命令行上直接设定PMU的Events(不使用预定义的分析类型),进行性能数据收集,参看这篇文章

2. 热点分析中,自定义采样时间间隔,参看这篇文章

分类: Blog Challenge, 并行计算, 英特尔® 软件网络 2.0
标签:

如需了解英特尔软件产品相关的性能和优化选项,请参阅优化注意事项.

 评论 (4)

2010年11月23日 03:51


Edwin Song
It is great information saving us tons of time, thanks a lot.
2010年12月08日 23:13


WIill
Great! 发现ampilifer比vtune9强大了不少,特别是对锁的判断方面,正在使用中。
2010年12月13日 21:47


Will
Hi peter, 我在用vtune ampilifer命令行形势采样hotspots的时候在采样完成后出现这个错误vtune Error: Error 0x40000024 (Reported error),我查了一下手册没有发现相关信息,你能否帮忙看看这个是什么错误?
我的命令是:
opt/intel/vtune_amplifier_xe_2011/bin64/amplxe-cl -collect hotspots -result-dir=/home/admin/vtune_amplifier_result/r1 -start-pause -resume-after 900000 -duration 930 app
2011年07月20日 06:15


zorra
peter:
您好,我运行
/opt/intel/vtune_amplifier_xe_2011/bin64/amplxe-runss --duration 125 --interval 1 -result-dir /home/admin/ay-searcher -- myprogram
/opt/intel/vtune_amplifier_xe_2011/bin64/amplxe-cl -report hotspots -r ay-searcher/
Using result path `/home/admin/ay-searcher'
Executing actions 74 % Generating a report

Result directory does not contain CPU samples.
Executing actions 99 % done
Error: Error 0x40000024 (Reporter error)
无论怎样都出现这样的错误,盼望解答

 引用 (6)


 写评论  

欲获得技术支持,请访问软件支持页面.
姓名 (必填)*

电子邮件 (必填,不在本页面显示)*

您的 URL (可选)


评论*