安装和运行oprofile

http://oprofile.sourceforge.net/

sudo apt-get install libpopt-dev

sudo apt-get install libiberty-dev

sudo apt-get install libz-dev

sudo apt-get install libbfd-dev

------------------------------------------------------------------------------------------------------------------------

遇到问题:运行 1.1.0 提示错误

tomren@tomren-xubuntu:~/Downloads/oprofile-1.1.0$ operf
Your kernel's Performance Events Subsystem does not support your processor type.
Please use the opcontrol command instead of operf.

解决方案:

下载源代码,安装 0.9.9的版本

------------------------------------------------------------------------------------------------------------------------

编译问题: 编译 0.9.9 错误

/home/tomren/Downloads/oprofile-0.9.9/libutil++/bfd_support.cpp:638: undefined reference to `bfd_elf64_powerpc_vec'
/home/tomren/Downloads/oprofile-0.9.9/libutil++/bfd_support.cpp:638: undefined reference to `bfd_elf64_powerpcle_vec'

解决方案:

下载 oprofile 的 1.1.0 版本,替换 libutil++bfd_support.cpp 中 bool bfd_info::get_sunth_sumbols() 函数。(只替换关于 "elf64_powerpc" 的判断即可)

------------------------------------------------------------------------------------------------------------------------

遇到问题:无法正常启动

[tomren@localhost Test]$ sudo opcontrol --start
/bin/opcontrol: line 1263: echo: write error: Device or resource busy

解决方案:
It seems that somehow oprofile has gotten into a weird state on your system.  I suggest doing the following:
    1. Reboot the system
    2. rm /root/.oprofile/daemonrc
    3. rm -rf /var/lib/oprofile
    4. Setup and run oprofile again

执行 2 可以解决

------------------------------------------------------------------------------------------------------------------------

遇到问题:没生成报告

[tomren@localhost Test]$ sudo opannotate -s t1
Using /var/lib/oprofile/samples/ for session-dir
error: no sample files found: profile specification too strict ?

解决方案:

sudo modprobe oprofile timer=1

转载于:https://www.cnblogs.com/tomren/p/6360087.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值