Skip to content

Programs forget on exit

Step 1 of 8Problem
STACK LIFE
single call
SHARED STATE
none alone
HEAP ALLOC
forbidden
SOLUTION
BPF maps
  • CPU hook write
  • userspace read / poll
  • ringbuf event stream
Maps & Data Sharing, step 1 of 8

An eBPF program runs to completion on one event and discards its 512-byte stack. It cannot call malloc() or keep ordinary global variables without a kernel data structure backing them.

To count packets, match request start to response end, or send telemetry to a daemon, hooks store everything inside BPF maps.

Type to search…

↑↓ navigate↵ selectEsc close