Skip to content

Instantly share code, notes, and snippets.

@psanford
Created August 9, 2019 18:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save psanford/ed89c98fb2036d452404d3dfae80bed8 to your computer and use it in GitHub Desktop.
Save psanford/ed89c98fb2036d452404d3dfae80bed8 to your computer and use it in GitHub Desktop.
build bpftrace on ubuntu 18.04
#!/bin/bash
set -e
set -x
# from https://www.joyfulbikeshedding.com/blog/2019-01-31-full-system-dynamic-tracing-on-linux-using-ebpf-and-bpftrace.html
apt-get install -y clang-7 libclang-7-dev llvm-7 llvm-7-dev
apt-get install -y bison cmake flex g++ git libelf-dev zlib1g-dev libfl-dev
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4052245BD4284CDD
echo "deb https://repo.iovisor.org/apt/$(lsb_release -cs) $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/iovisor.list
apt-get update
apt-get install -y bcc-tools libbcc-examples linux-headers-$(uname -r)
git clone https://github.com/iovisor/bpftrace
cd bpftrace
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=DEBUG ..
make -j4
sudo make install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment