profile是用于追踪程序执行调用流程的工具,类似于perf中的-g指令

相比perf -g而言,profile功能化更加细分,可以根据需要选择追踪层面,例如-U(用户要调用流程) -K (内核态调用流程)

下面具体介绍该工具的使用

采用profile --help,我们可以看到如下介绍:

usage: profile [-h] [-p PID] [-U | -K] [-F FREQUENCY | -c COUNT] [-d] [-a]
[-f] [--stack-storage-size STACK_STORAGE_SIZE] [-C CPU]
[duration] Profile CPU stack traces at a timed interval positional arguments:
duration duration of trace, in seconds # profile的持续时间 optional arguments:
-h, --help show this help message and exit
-p PID, --pid PID profile this PID only # 只追踪该pid的调用流程
-U, --user-stacks-only                   # 查看用户态函数调用流程
show stacks from user space only (no kernel space
stacks)
-K, --kernel-stacks-only                  # 只查看内核态调用流程
show stacks from kernel space only (no user space
stacks)
-F FREQUENCY, --frequency FREQUENCY # profile追踪采样频率 例如: -F 99 表示按照99hz的频率进行采样,默认是采用的49hz
sample frequency, Hertz
-c COUNT, --count COUNT                   # 选择采样次数 -c 5表示在周期内采样5次,-c和-F两者不能同时使用
sample period, number of events
-d, --delimited insert delimiter between kernel/user stacks # 在内核和用户态之间插入分界符 “---”
-a, --annotations add _[k] annotations to kernel frames # 在显示的内核函数后面标记 '[k]'标识
-f, --folded output folded format, one line per stack (for flame #采用横向线上模式 xxx;xxx_1;xxxxx_2
graphs)
--stack-storage-size STACK_STORAGE_SIZE                 # 设置调用栈的使用空间和默认支持空间大小
the number of unique stack traces that can be stored
and displayed (default )
-C CPU, --cpu CPU cpu number to run profile on           # 允许几个cpu运行profile程序      examples:
./profile # profile stack traces at Hertz until Ctrl-C
./profile -F # profile stack traces at Hertz
./profile -c # profile stack traces every in a million events
./profile # profile at Hertz for seconds only
./profile -f # output in folded format for flame graphs
./profile -p # only profile threads for PID
./profile -U # only show user space stacks (no kernel)
./profile -K # only show kernel space stacks (no user)

下面对相关重要指令进行测试分析:

    1. profile -f

      在没有添加-f参数时,可看出是一行线上一个函数调用信息

      加入-f参数后,采用每行递增线上函数调用信息。

    2. profile -d  :用于将内核态和用户态函数通过"--"分割开来,如下图红色框框所示

      3.profile -F  :用于设置该工具采样频率

      

      4. profile -K -a :用于仅显示内核调用函数,并且在函数后面增加"_[K]"标识 (156标识进程id号)

      

      5. profile -c :在采样周期内对每一个线程xx个event进行采样

      

bcc-tools工具之profile的更多相关文章

  1. instsrv.exe下载和使用方法(微软Windows Server 2003 Resource Kit Tools工具中的一个)

    instsrv.exe是微软Windows Server 2003 Resource Kit Tools工具中的一个. Windows Server 2003 Resource Kit Tools是一 ...

  2. MTK Android software Tools工具的说明

    MTK发布的Android software Tools工具包,里面包含了很多的MTK工具,如下是简要说明及学习文档 MTK Android software Tools工具的说明如下: 工具 说明 ...

  3. kail linux虚拟机安装tools工具

    因为自己比较懒,有时候自己不想打字需要粘贴就安装了虚拟机tools工具,又因为自己脑子不好使所以就写一下步骤,以便以后用得着.我这里用得是kail linux系统,不知道contest能不能这样安,下 ...

  4. 【申嵌视频】5-1 ubuntu下安装VMWare Tools工具

    [申嵌视频]5-1 ubuntu下安装VMWare Tools工具 适合搭建mini2440, Tiny6410, smart210,Tiny4412, NanoPC-T2, NanoPC-T3, N ...

  5. 解决Linux安装 VMware tools 工具的方法

    一:启动linux服务器,并用远程登录工具访问linux服务器 1:启动系统 2:用服务器控制台   :查看点ip地址 3:用客户端 连接服务器 二:挂起 vm虚拟机的 tools 安装光盘 三:开始 ...

  6. Linux下 安装VMware Tools工具

    Linux下需要安装VMware Tools工具 Linux下需要安装VMware Tools工具来实现主机和虚拟机直接文件复制粘贴功能,安装方法如下: ①点击虚拟机VM菜单栏--虚拟机--安装VMw ...

  7. 【Linux】VMware安装VMware Tools工具

    VMware Tools是VMware虚拟机中自带的一种增强工具,相当于VirtualBox中的增强功能(Sun VirtualBox Guest Additions),是VMware提供的增强虚拟显 ...

  8. VS混淆/反编译/远程调试/Spy++的Tools工具

    VS的Tools工具(混淆/反编译/远程调试/Spy++等) https://blog.csdn.net/chunyexiyu/article/details/14445605 参考:http://b ...

  9. 虚拟机乌班图系统安装 VMware tools 工具

    在VMware虚拟机中安装完毕Linux操作系统之后,我们经常会发现桌面不能全屏显示或者windows主机系统与linux操作系统之间无法创建共享文件夹.这是因为我们还没有安装VMware tools ...

  10. 第三篇:Entity Framework CodeFirst & Model 映射 续篇 EntityFramework Power Tools 工具使用

    上一篇 第二篇:Entity Framework CodeFirst & Model 映射 主要介绍以Fluent API来实作EntityFramework CodeFirst,得到了大家一 ...

随机推荐

  1. 使用canvas给图片添加水印, canvas转换base64,,canvas,图片,base64等转换成二进制文档流的方法,并将合成的图片上传到服务器,

    一,前端合成带水印的图片 一般来说,生成带水印的图片由后端生成,但不乏有时候需要前端来处理.当然,前端处理图片一般不建议,一方面js的处理图片的方法不全,二是有些老版本的浏览器对canvas的支持度不 ...

  2. magento 为用户注册增加一个字段

    步骤 I. 加一个occupation/title字段到用户注册页,差不多在register.html的54行,在email下方加一个Occupation显示代码 代码: <li>< ...

  3. SQL 查询子句

    SQL WHERE Clause(查询子句) WHERE 子句用于过滤记录. SQL WHERE 子句 WHERE子句用于提取满足指定标准的记录. SQL WHERE 语法 SELECT column ...

  4. PHP ftp_delete() 函数

    定义和用法 ftp_delete() 函数删除 FTP 服务器上的一个文件. 如果成功,该函数返回 TRUE.如果失败,则返回 FALSE 和一个警告. 语法 ftp_delete(ftp_conne ...

  5. linux环境下安装PHP的OpenSSL扩展

    先安装依赖包:yum install openssl openssl-devel 进入PHP安装包里的OpenSSL文件夹,根据个人的安装包位置不同,此处是 cd /home/local/php.5. ...

  6. BZOJ 3430: [Usaco2014 Jan]Ski Course Rating(并查集+贪心)

    题面 Time Limit: 10 Sec Memory Limit: 128 MB Submit: 136 Solved: 90 [Submit][Status][Discuss] Descript ...

  7. 在Visual C++中使用内联汇编

    一.内联汇编的优缺点 因为在Visual C++中使用内联汇编不需要额外的编译器和联接器,且可以处理Visual C++中不能处理的一些事情,而且可以使用在C/C++中的变量,所以非常方便.内联汇编主 ...

  8. VMware Network Adapter VMnet1/8详解

    转自:https://www.cnblogs.com/systemnet123/articles/2640883.html VMWare提供了三种工作模式,它们是bridged(桥接模式).NAT(网 ...

  9. es批量索引

    使用Python操作Elasticsearch数据索引的教程 这篇文章主要介绍了使用Python操作Elasticsearch数据索引的教程,Elasticsearch处理数据索引非常高效,要的朋友可 ...

  10. Linux上VNC 启动和关闭

    查询vnc的线程: [admin@cn2-uat-esb-01-0001 ~]$ ps -ef|grep vncadmin 19080 21305 0 10:04 pts/2 00:00:00 gre ...