本文转自 https://software.intel.com/zh-cn/blogs/2010/11/10/amplxe-cl/
版权归原作者所有,如原作者有任何不允许转载之理由,本文将自行删除。

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]

解释

<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 hotspots -r r0003lw -group-by function-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. 热点分析中,自定义采样时间间隔,参看这篇文章

3. 如果工作目录不含 :执行文件,符号文件 和 源代码,需要对结果重新处理。如:Using “amplxe-cl -finalize --search-dir all:rp=new-dir -r result-dir” to solve this problem. You could use "bin", "sym", "src" instead of "all" if you only need to do one of them.

4. Now XE 2013 supports stack-sampling with hardware event-based sampling, add options "-knob enable-stack-collection=true -knob enable-call-counts=true"

5. Since XE 2013 Update 10, the user can know hot addresses or hot addresses with basic block from report. See this example:

# amplxe-cl -collect advanced-hotspots -- ./primes.icc

# amplxe-cl -report hw-events -filter module=primes.icc -source-object function=findPrimes -group-bybasic-block,address

【性能分析】使用Intel VTune Amplifier的更多相关文章

  1. Intel VTune Amplifier XE 使用

    VTune <VTune 开发者手册> 1. 安装 1.1 软件安装 下载: (安装包下载地址) 安装: # 1.解压 tar -zxvf filename.tar.gz # 2.安装 c ...

  2. intel vtune 介绍、安装和使用

    intel vtune 介绍 https://software.intel.com/en-us/vtune intel vtune 安装包下载地址 https://software.intel.com ...

  3. 性能分析之profiling及火焰图

    profiling 是一项非常重要的,但又对很多程序员陌生的技术,它尤其对性能调优有显著帮助.本文以Brendan对perf的介绍稍加引入[底层涉及了太多细节,目前仅关心如何用它对服务器应用进行use ...

  4. CPU性能分析工具原理

    转载请保留以下声明 作者:赵宗晟 出处:https://www.cnblogs.com/zhao-zongsheng/p/13067733.html 很多软件都要做性能分析和性能优化.很多语言都会有他 ...

  5. 《Java Performance》笔记1——性能分析基础 2

    4.内存使用率: 内存使用率的相关属性包括页面调度或页面交换.加锁.线程迁移中的让步式和抢占式上下文切换. 当应用运行所需的内存超过可用物理内存时,就会发生内存页面交换,系统在进行页面交换或使用虚拟内 ...

  6. CPU性能分析

    CPU性能分析工具 lscpu:查看CPU硬件信息 lscpu Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Byte Order: Litt ...

  7. x86服务器中网络性能分析与调优 转

    x86服务器中网络性能分析与调优 2017-04-05 巨枫 英特尔精英汇 [OpenStack 易经]是 EasyStack 官微在2017年新推出的技术品牌,将原创技术干货分享给您,本期我们讨论 ...

  8. 浅谈Unity的渲染优化(1): 性能分析和瓶颈判断(上篇)

    http://www.taidous.com/article-667-1.html 前言 首先,这个系列文章做个大致的介绍,题目"浅谈Unity",因为公司和国内大部分3D手游开发 ...

  9. CSS动画的性能分析和浏览器GPU加速

    此文已由作者袁申授权网易云社区发布. 欢迎访问网易云社区,了解更多网易技术产品运营经验. 有数的数据大屏可以在一块屏幕上展示若干张不同的图表,以炫酷的方式展示各种业务数据.其中有些图表使用CSS实现了 ...

随机推荐

  1. consul service

    {      "name": "consul-agent (host:{{ .MONITOR_CONSUL }})",      "command&q ...

  2. Volley的简单封装

    算了一下,好像有很久没有写博客了.其实,关于写博客这件事,我从来没有把他当成我的一种任务,而是在学习过程中的一种总结和自我发现,同样也是为了练一练文笔,说不定有一天,我也能出一本书像<第一行代码 ...

  3. Java核心技术-集合

    在实现方法时,选择不同的数据结构会导致其实现风格以及性能存在着很大的差异,例如: 需要快速地搜索成千上万个有序的数据项吗?需要快速地在有序的序列中插入和删除元素吗?需要建立键与值之间的关联吗? 1 J ...

  4. 30-python3 中 bytes 和 string 之间的互相转换

    转自:http://www.jb51.net/article/105064.htm password = b'123456' 等价于: pw = '123456' password = pw.enco ...

  5. [SoapUI]怎样保存response到本地文件夹

    def myOutFile = "D:/AUS/Aspect Huntley feed URLs/Automation Save Responses/ahresearch.xml" ...

  6. [Selenium]刷新页面 Refresh page

    5 different ways to refresh a webpage using Selenium Webdriver   Here are the 5 different ways, usin ...

  7. Linux下编译busybox时出现的问题

    编译busybox的时候出现了一个问题: sync.c:(.text.sync_main+0x78): undefined reference to `syncfs' collect2: ld ret ...

  8. pthread_rwlock_rdlock和“No such file or directory”

    pthread_rwlock_rdlock和"No such file or directory" 调用pthread_rwlock_rdlock时,如果失败报错"pth ...

  9. I-Keyboard

    SPOJ Problem Set (classical) 14. I-Keyboard Problem code: IKEYB Most of you have probably tried to t ...

  10. Codeforces 766D Mahmoud and a Dictionary 2017-02-21 14:03 107人阅读 评论(0) 收藏

    D. Mahmoud and a Dictionary time limit per test 4 seconds memory limit per test 256 megabytes input ...