使用oprofile 过程
来源:互联网 发布:触摸校准的软件 编辑:程序博客网 时间:2024/06/13 08:35
oprofile 主要用来分析某个模块的某些函数占用cpu的情况。
oprofile 从安装到使用具体步骤如下:
安装如下:
1
从http://oprofile.sourceforge.net/download/ 下oprofile的最新版本:oprofile-0.9.6.tar.gz(目前为止)
2
解压后,在oprofile-0.9.6文件夹中运行 ./configure --with-kernel-support 。在最后会遇到一个
问题1:
configure: error: liberty library not found
解决:
yum install binutils-devel
3make ; make install之后,会在/usr/local/bin下存在opcontrol 等命令。使用如下运行oprofile需要root权限,因为它要加载profile模块,启动oprofiled后台程序等。所以在运行之前,就需要切换到root。
- opcontrol --init 加载模块,mout /dev/oprofile 创建必需的文件和目录
- opcontrol --separate=kernel --vmlinux=/boot/2.6.0/vmlinux
- opcontrol --reset 清楚当前会话中的数据
- opcontrol --start 开始profiling
- ./hello 运行应用程序,oprofile会对它进行profiling
- opcontrol --dump 把收集到的数据写入文件 (缺省数据保存在/var/lib/oprofile)
- opcontrol --stop 停止profiling
- opcotrol -h 关闭守护进程oprofiled
- opcontrol --shutdown 停止oprofiled
- opcontrol --deinit 卸载模块
- opcontrol --deinit 卸载模块
opcontrol详细使用参考:http://oprofile.sourceforge.net/doc/controlling.html
opontrol start前面的一些设置,主要是写入了/root/.oprofile/daemonrc文件中
常用的是3→7这几个过程,得到性能数据之后,可以使用opreport, opstack, opgprof, opannotate几个工具进行分析,我常用的是opreport, opannotate进行分析。
oprofile 结果分析examples
http://oprofile.sourceforge.net/examples/
相关参考资料:OProfile manual:
http://oprofile.sourceforge.net/doc/index.html
source性能分析工具Oprofile详细解析
http://blog.csdn.net/Gengoo/archive/2010/01/28/5265930.aspx
注意如下事项:
1
oprofile 安装时遇到到那个问题 : liberty library not found
2
oprofile 不能再虚拟机中使用
3
使用opcontrol命令时,必须指定自己的vmlinux
- 使用oprofile 过程
- Oprofile 编译使用过程中遇到的几个错误
- Oprofile工具的使用
- Linux oprofile 使用
- 初次使用oprofile
- OProfile安装和使用
- oprofile的使用
- oprofile的使用
- oprofile安装和使用
- 安装使用oprofile
- 使用oprofile-1.1.0
- oprofile
- oprofile
- Oprofile
- oprofile
- oprofile
- OProfile
- oProfile
- PB编译:error SYSGEN0000: error(s) in sysgen phase
- Java应用swing改变观感(补充)【转】
- temp
- HI HAO A
- LinkedListDemo
- 使用oprofile 过程
- 使用BackTrack4清除/修改Windows用户密码
- is not allowed to connect to this mysql server
- 如何检查电脑是否被安装木马及防范技巧
- 嵌入式linux c 学习笔记3-date
- C语言读PCI
- sql refid
- vb.net控制TextBox控件只能输入数值型字符串
- 剑盟现在开放注册了