EBPF

From Wiki 4 Men
Revision as of 12:50, 29 June 2025 by Robert Brockway (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search


Prepare

Might be needed:

sudo ln -s /usr/include/x86_64-linux-gnu/asm /usr/include/asm

sudo apt install bpftool clang llvm libbpf-dev

bpftool btf dump file /sys/kernel/btf/vmlinux format c > vmlinux.h

Compile

clang -O2 -g -target bpf -c trace_file_delete.c -o trace_file_delete.o


Load

bpftool prog load trace_file_delete.o /sys/fs/bpf/trace_file_delete

List

bpftool prog list

Unload

rm /sys/fs/bpf/trace_file_delete

External Links


This is a draft article and so will not be published on A Voice for Men or appear in random article selections. Wiki4Men is looking for trustworthy editors that can turn draft articles in to featured articles. Information on how to apply is on the Main Page.

Technical articles in this category are applicable to Linux. Debian GNU/Linux is used in examples. Much of the information is also applicable to other Linux distributions and Unix flavours.