Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save nitingupta910/520f5218074e355ee9107aadae52e4d5 to your computer and use it in GitHub Desktop.
Save nitingupta910/520f5218074e355ee9107aadae52e4d5 to your computer and use it in GitHub Desktop.
Installing BCC and bpftrace from source on Ubuntu 18.04

Steps to install BCC and bpftrace from source on Ubuntu 18.04.

BCC

Install build dependencies

sudo apt-get -y install bison build-essential cmake flex git libedit-dev \
  libllvm6.0 llvm-6.0-dev libclang-6.0-dev python zlib1g-dev libelf-dev \
  iperf3 luajit libluajit-5.1-dev netperf linux-headers-$(uname -r)

Compile and install BCC

git clone https://github.com/iovisor/bcc.git
mkdir bcc/build; cd bcc/build
cmake .. -DCMAKE_INSTALL_PREFIX=/usr
make -j16
sudo make install

bpftrace

Install build dependencies

sudo apt-get install -y bison cmake flex g++ git libelf-dev zlib1g-dev libfl-dev systemtap-sdt-dev binutils-dev \
  llvm-7-dev llvm-7-runtime libclang-7-dev clang-7

Compile and install bpftrace

git clone https://github.com/iovisor/bpftrace
mkdir bpftrace/build; cd bpftrace/build;
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j16
sudo make install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment