oprofile 安装使用

ubuntu上要编译安装oprofile。现在版本(0.9.9)的oprofile的编译需要binutil-dev libpopt-dev

apt-get install binutil-dev libpopt-dev

然后./configure make make install

安装完以后

1.执行opcontrol --init启动加载oprofile模块

2.opcontrol --no-vmlinux

3.(可选)opcontrol --event=L2_CACHE_MISS:500 查看cache miss率,增加监听事件

4.opcontrol --start 启动op

5.运行待检测程序(必须用-g选项编译,不然没有源代码)

6.opcontrol –dump取出数据

7.opcontrol --stop 停止检测

8.opannotate --source 待检测程序

参考

http://www.ibm.com/developerworks/cn/linux/l-pow-oprofile/index.html

http://www.ibm.com/developerworks/cn/linux/l-oprof/index.html

原文地址:https://www.cnblogs.com/sickboy/p/3413801.html