bpf tracing multi-link supporting
summary
Implements a global trampoline that uses an rhashtable to map target function addresses to metadata (BPF programs, cookie, arg count), letting one BPF program attach to many functions instead of cloning per-function instances. Built with rhashtable plus naked functions and C on x86_64, it cuts large-scale attach time from tens of minutes to under 1 second for 50k functions. Limits: no static args over six, no jump model, per-call hash lookup adds runtime overhead (bench shows ~25% hit in one case) and falls back to per-function trampolines when needed.
AI-written summary · about
chapters (12)
- 0:00Introduction and overview
- 1:50BPF trampoline basics
- 3:43Limitations of current tracing
- 5:09Ftrace and trampoline attachment
- 8:40Single ftrace object optimization
- 9:03BPF multi-link concept
- 12:40Function metadata design
- 15:16Attachment during loading time
- 17:02BPF global link implementation
- 19:30Modifying trampoline updates
- 21:20Performance and issues
- 25:24Q&A discussion
