1. 程式人生 > >Centos Oprofile 安裝過程的幾個錯誤注意點

Centos Oprofile 安裝過程的幾個錯誤注意點

1. 確認oprofile 是否被編譯進核心,是模組方式還是別的方式

cat /boot/config-2.6.18-128.el5 |grep OPROFILE

2. 配置中錯誤 ./configure

checking dynamic linker characteristics... GNU/Linuxld.so checking how to hardcode library paths into programs... immediatechecking for ld... /usr/bin/ld -m elf_x86_64 checking for kernel OProfilesupport... no

configure: error: no suitably configured kernel includetree found

錯誤原因:沒有kernel headers 

解決辦法:

a.  ./configure –with-kernel-support  

下面是configure 的幾個引數



--with-binutils=dirPath to binutils installation to use
  --with-binutils-libname       Lib dir name under binutils installation; [lib]]
  --with-gcc=dirPath to GCC installation to use
  --with-kernel-support        Use 2.6 kernel (no kernel source tree required)
  --with-linux=dir             Path to Linux source tree
  --with-module-dir=dir        Path to module installation directory
  --with-java=java-home        Path to Java home directory
  --with-extra-includes=DIR    add extra include paths
  --with-extra-libs=DIR        add extra library paths
  --with-target=cell-be   Check BFD support for Cell Broadband Engine SPU profiling
  --with-x                use the X Window System
  --with-qt-dir           where the root of Qt is installed
  --with-qt-includes      where the Qt includes are.
  --with-qt-libraries     where the Qt library is installed.

b. 安裝 kernel-devel rpm 包

具體 細節 可以參考 :blog : http://blog.csdn.net/raintungli/article/details/5935481 中安裝kernel-devel 的包

3. 配置中錯誤

checking for libiberty.h... no
checking for cplus_demangle in -liberty... no
configure: error: liberty library not found

錯誤原因: 缺少 liberty  包

解決辦法: 安裝 binutils-devel包

yum install binutils-devel -y