本文转自 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. Type Object——类型对象

    clr会为应用程序使用的每个类型创建一个内部数据结构,这种数据结构称为类型对象. 具有泛型类型参数的类型称为开放类型(open type),CLR禁止构造开放类型的任何实例. 代码引用一个泛型类型时, ...

  2. mysql常用的信息查询函数

    mysql常用信息函数 select version(); --当前数据库服务器版本信息 select database(); --当前使用的数据库 select current_user() 或 s ...

  3. linux下mysql开启远程访问权限及防火墙开放3306端口(mysql开放host访问权限)

    开启mysql的远程访问权限默认mysql的用户是没有远程访问的权限的,因此当程序跟数据库不在同一台服务器上时,我们需要开启mysql的远程访问权限.主流的有两种方法,改表法和授权法.相对而言,改表法 ...

  4. python多线程与线程

    进程与线程的概念 进程 考虑一个场景:浏览器,网易云音乐以及notepad++ 三个软件只能顺序执行是怎样一种场景呢?另外,假如有两个程序A和B,程序A在执行到一半的过程中,需要读取大量的数据输入(I ...

  5. Luogu 4449 于神之怒加强版

    挺套路的题,然而一开始还是想错了…… $\sum_{i = 1}^{n}\sum_{j = 1}^{m}gcd(i, j) ^ {k} = \sum_{T = 1}^{min(n, m)}\left ...

  6. PHP语言性能优化——少使用魔术方法

    对以下使用魔术方法和不适用魔术方法运行时间进行比较 使用魔术方法test1.php: <?php /** * 测试类 */ class test { private $name = " ...

  7. 阅读xtrabackup代码的一点笔记

    xtrabackup binary最重要的两个过程是backup和prepare,对应的函数分别是xtrabackup_backup_func()和xtrabackup_prepare_func(), ...

  8. Bitmap Images and Image Masks

    [Bitmap Images and Image Masks] Bitmap images and image masks are like any drawing primitive in Quar ...

  9. 视频转换工具ffmpeg

    安装ffmpeg ffmpeg官网下载地址点击此处. 如果使用mac也可用homebrew下载安装:brew install ffmpeg 使用ffmpeg 命令如下:ffmpeg -i input. ...

  10. 关于:Warning: skipping non-radio button in group的处理方法整理

    下面讲的是一个意思: The problem is that the next control in the tab order following the last radio button of ...