美文网首页
2021-03-12 eBPF监控工具bcc(BPF Compi

2021-03-12 eBPF监控工具bcc(BPF Compi

作者: 5A风景区 | 来源:发表于2021-03-12 14:26 被阅读0次

相关文章

使用BCC工具分析系统性能
使用BCC提取内核网络流量信息
bcc 工具包的安装和使用 redhat

官方安装文档

https://github.com/iovisor/bcc/blob/master/INSTALL.md#ubuntu---binary

bcc源码安装

#平台 ubuntu 18.04 ,内核版本4.15.0-136-generic
git clone https://github.com/iovisor/bcc.git
mkdir bcc/build; cd bcc/build
cmake .. -DCMAKE_INSTALL_PREFIX=/usr

make install

报错及解决

Q:
CMake Error at CMakeLists.txt:65 (find_package):
  Could not find a package configuration file provided by "LLVM" with any of
  the following names:

    LLVMConfig.cmake
    llvm-config.cmake

  Add the installation prefix of "LLVM" to CMAKE_PREFIX_PATH or set
  "LLVM_DIR" to a directory containing one of the above files.  If "LLVM"
  provides a separate development package or SDK, be sure it has been
  installed.
A:
apt install llvm
Q:
-- Could NOT find FLEX (missing: FLEX_EXECUTABLE) 
CMake Error at /usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
  Could NOT find LibElf (missing: LIBELF_LIBRARIES LIBELF_INCLUDE_DIRS)
Call Stack (most recent call first):
  /usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
  cmake/FindLibElf.cmake:50 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:71 (find_package)
A:
apt install flex
Q:
  Could NOT find LibElf (missing: LIBELF_LIBRARIES LIBELF_INCLUDE_DIRS)
Call Stack (most recent call first):
  /usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
  cmake/FindLibElf.cmake:50 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:71 (find_package)
A:
apt-get install libelf-dev
Q:
Unable to find clang libraries
A:
apt-get install libclang-6.0-dev

Q:
-- Could NOT find LuaJIT (missing: LUAJIT_LIBRARIES LUAJIT_INCLUDE_DIR) 
CMake Warning at tests/python/CMakeLists.txt:10 (message):
  Recommended test program 'netperf' not found


CMake Warning at tests/python/CMakeLists.txt:16 (message):
  Recommended test program 'iperf' or 'iperf3' not found
A:
apt install netperf
apt install luajit
apt install iperf

尚未解决的问题

Q:
Traceback (most recent call last):
  File "/data1/mycode/BCC/helloword.py", line 1, in <module>
    from bcc import BPF
ImportError: cannot import name BPF
A:
可能是由于需要4.6版本以上的内核,也可能是需要修改内核参数重新编译,总之现在在ubuntu 环境下 BPF安装不上

相关文章

网友评论

      本文标题:2021-03-12 eBPF监控工具bcc(BPF Compi

      本文链接:https://www.haomeiwen.com/subject/lrrzqltx.html