jcetina / ebpf

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ebpf

Starting point for me

Core concepts

Programming model

  • A userspace program loads an ebpf program into the kernel via the bpf syscall.
  • The above userspace program and the ebpf program communicate via message passing using eBPF maps.
  • Message passing uses eBPF maps for data. There are multiple map types.
    • There are helpers in bpf-helpers to setup different ebpf map types.

kprobes

  • https://www.kernel.org/doc/html/v5.10/trace/kprobes.html
  • Hook almost any kernel routine
  • Gets packaged like a kernel module
  • Can modify registers and stack - be careful (dbl check - what does the verifier do for kprobe safety)
  • Can run pre or post call
  • Unstable across kernel versions

tracepoints

Useful links

About