bcc-tools工具之profile
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)
下面对相关重要指令进行测试分析:
- profile -f
在没有添加-f参数时,可看出是一行线上一个函数调用信息

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

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

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

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

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

bcc-tools工具之profile的更多相关文章
- instsrv.exe下载和使用方法(微软Windows Server 2003 Resource Kit Tools工具中的一个)
instsrv.exe是微软Windows Server 2003 Resource Kit Tools工具中的一个. Windows Server 2003 Resource Kit Tools是一 ...
- MTK Android software Tools工具的说明
MTK发布的Android software Tools工具包,里面包含了很多的MTK工具,如下是简要说明及学习文档 MTK Android software Tools工具的说明如下: 工具 说明 ...
- kail linux虚拟机安装tools工具
因为自己比较懒,有时候自己不想打字需要粘贴就安装了虚拟机tools工具,又因为自己脑子不好使所以就写一下步骤,以便以后用得着.我这里用得是kail linux系统,不知道contest能不能这样安,下 ...
- 【申嵌视频】5-1 ubuntu下安装VMWare Tools工具
[申嵌视频]5-1 ubuntu下安装VMWare Tools工具 适合搭建mini2440, Tiny6410, smart210,Tiny4412, NanoPC-T2, NanoPC-T3, N ...
- 解决Linux安装 VMware tools 工具的方法
一:启动linux服务器,并用远程登录工具访问linux服务器 1:启动系统 2:用服务器控制台 :查看点ip地址 3:用客户端 连接服务器 二:挂起 vm虚拟机的 tools 安装光盘 三:开始 ...
- Linux下 安装VMware Tools工具
Linux下需要安装VMware Tools工具 Linux下需要安装VMware Tools工具来实现主机和虚拟机直接文件复制粘贴功能,安装方法如下: ①点击虚拟机VM菜单栏--虚拟机--安装VMw ...
- 【Linux】VMware安装VMware Tools工具
VMware Tools是VMware虚拟机中自带的一种增强工具,相当于VirtualBox中的增强功能(Sun VirtualBox Guest Additions),是VMware提供的增强虚拟显 ...
- VS混淆/反编译/远程调试/Spy++的Tools工具
VS的Tools工具(混淆/反编译/远程调试/Spy++等) https://blog.csdn.net/chunyexiyu/article/details/14445605 参考:http://b ...
- 虚拟机乌班图系统安装 VMware tools 工具
在VMware虚拟机中安装完毕Linux操作系统之后,我们经常会发现桌面不能全屏显示或者windows主机系统与linux操作系统之间无法创建共享文件夹.这是因为我们还没有安装VMware tools ...
- 第三篇:Entity Framework CodeFirst & Model 映射 续篇 EntityFramework Power Tools 工具使用
上一篇 第二篇:Entity Framework CodeFirst & Model 映射 主要介绍以Fluent API来实作EntityFramework CodeFirst,得到了大家一 ...
随机推荐
- react 数据发生变化,页面改变的原理
数据发生变化,页面改变的原理: 比较虚拟的dom 不怎么损耗性能,真实的dom比较会损耗性能 1.state 数据 2.jsx 模板 3.生成虚拟的dom 3.数据和模板结合,生成虚拟的dom 4.用 ...
- Angularjs书写规范
文件命名原则: 遵循以描述组件功能,然后是类型(可选)的方式来给所有的组件提供统一的命名 命名:feature.type.js. 测试文件名(feature.type.spec.js) 大多数文件都有 ...
- 分考场(np完全问题,回溯法)
问题描述 n个人参加某项特殊考试. 为了公平,要求任何两个认识的人不能分在同一个考场. 求是少需要分几个考场才能满足条件. 输入格式 第一行,一个整数n(1<n<100),表示参加考试的人 ...
- JDK1.8之后的新特性和新接口
接口的旧特性: 就特性下接口中只有: 常量(必须赋值) 抽象方法abstract(和final static private三个关键字冲突) interface Inter { //int a ; / ...
- JS数组 Array
1.创建数组 var array=new Array(); 2.添加数组 array.push("111"); array.push("111"); array ...
- Java——is-a、is-like-a、has-a
3.8 is-a.is-like-a.has-a 3.8.1 is-a(类和类之间的继承关系,泛化关系) public class Animal{ public void method1() ; } ...
- css创建
CSS 创建 当读到一个样式表时,浏览器会根据它来格式化 HTML 文档. 如何插入样式表 插入样式表的方法有三种: 外部样式表(External style sheet) 内部样式表(Interna ...
- Hbase节点的管理|服役和退役节点
Base节点的管理 1.服役(commissioning) 当启动regionserver时,regionserver会向Hmaster注册并开始接收本地数据,开始的时候,新加入的节点不会有任何数据, ...
- angularjs 中 Factory,Service,Provider 之间的区别
本片文章是使用了 angularjs 中使用 service 在controller 之间 share 对象和数据 的code(http://jsfiddle.net/kn46u0uj/1/) 来进行 ...
- 探索C++的秘密之详解extern
转载:http://developer.51cto.com/art/200704/46843.htm C和C++对函数的处理方式是不同的.extern "C"是使C++能够调用C写 ...