编译部署bcc/
apt-get install clang libclang-7-dev cmake
git clone https://github.com/iovisor/bcc.git
cd bcc/
mkdir -p build
cd build/
export CC=clang-7
export CXX=clang++-7
cmake .. -DCMAKE_INSTALL_PREFIX=/usr
lscpu
make -j48
make install
验证
/usr/share/bcc/tools/cachestat
编译部署eBPF
git clone https://github.com/iovisor/bpftrace
cd bpftrace/
mkdir -p build
cd build/
export CC=clang-7
export CXX=clang++-7
cmake .. -DCMAKE_BUILD_TYPE=Debug
lscpu
make -j48
make install
验证
bpftrace -e 'kprobe:do_nanosleep { printf("PID %d sleeping... \n", pid) }'