---
# System prepended metadata

title: eBPF Intro
tags: [bcc, eBPF]

---

---
title: eBPF Intro
image: 
description: 
---
# eBPF Intro
###### tags: `eBPF` `bcc`


## eBPF

## bcc

* `bcc`是`eBPF`的一個工具集，是eBPF的上層封装，它的形式是python中嵌入`bpf`。
* python部分的作用是為使用者提供友好的`eBPF`上層接口，也用於數據處理。`bpf`會注入`kernel`，提取資料。
### bcc Install
> 待測
* [official install](https://github.com/iovisor/bcc/blob/master/INSTALL.md#ubuntu---source)
* [Problem fix](https://stackoverflow.com/questions/61978175/how-to-compile-bcc-on-ubuntu-20-04)
* my install method
```bash=
$ sudo apt install -y bison build-essential cmake flex git libedit-dev \
  libllvm7 llvm-7-dev libclang-7-dev python zlib1g-dev libelf-dev libfl-dev
# 應該是都換成 10 就沒事了
$ sudo apt-get install libclang-10-dev

$ git clone https://github.com/iovisor/bcc.git
$ mkdir bcc/build; cd bcc/build
$ cmake -Bbuild -DPYTHON_CMD=python3 -DCMAKE_PREFIX_PATH=/usr/lib/llvm-10
$ make -Cbuild -j4
$ cd build
$ pushd src/python/
$ make -j4
$ sudo make install
$ popd
$ sudo make install
```