Profiling & visualization tool based on eBPF
Download the newest version in Releases
Usage
sudo ./sberf record <PID1>,<PID2>
# sudo ./sberf record 1001
# sudo ./sberf record 1001,32847
Usage:
sberf record [options]
Options:
-p[--pid]: Record running time
-t[--tracepoint]: Record tracepoints' triggered time
-s[--syscall]: Record stack traces when a syscall is triggered
-m[--memory]: Record memory usage
-op[--off-cpu]: Record OFF-CPU time
-h[--help]: Print this help message
-f: Frequency in Hz
-np: No plotting, print the stacks instead
-a: Record all processes
-o: File name for the plot
- Install bpftool
git clone https://github.com/libbpf/bpftool.git
cd src
make
make install
- Install libbpf
git clone https://github.com/libbpf/libbpf.git
cd src
make
make install
- Install Clang
# ubuntu
sudo apt-get install clang
# centos
sudo yum install clang
- Clone this repo
git clone https://github.com/Sberm/sberf.git
cd sberf
- Generate vmlinux.h
# generate vmlinux.h file to vmlinux folder
bpftool btf dump file /sys/kernel/btf/vmlinux format c > vmlinux/vmlinux.h
- Make
# mute
make
# verbose message
DEBUG=1 make
bpf.c
Programs that run on eBPF virtual machine
.c
Regular c programs
- Use libperf instead of eBPF stack trace
- OpenTelemetry or any popular format compatibility