安装和运行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

posted @ 2017-02-01 16:28  tomren  阅读(593)  评论(0编辑  收藏  举报