Files
Zachary D. Rowitsch c84dfdc508
All checks were successful
Build & Package / build (push) Successful in 9m34s
feat: add PerfEventArray fallback for kernel 4.18+ (RHEL/AlmaLinux 8)
Add a second eBPF program variant using PerfEventArray instead of
RingBuf, enabling tcptop to run on kernels older than 5.8 (e.g.,
AlmaLinux 8.10 with kernel 4.18). At startup, the collector detects
kernel version via uname and selects the appropriate variant, with
automatic fallback on load failure.

Key changes:
- New tcptop-ebpf-perf crate using PerfEventArray and bpf_probe_read
  (instead of bpf_probe_read_kernel which requires 5.5+)
- Runtime kernel version detection and dual-binary loading in linux.rs
- Per-CPU async perf event consumption via tokio tasks
- Zero-initialized event union to satisfy the 4.18 BPF verifier
- Tracepoint attach made non-fatal for maximum kernel compatibility

Tested on AlmaLinux 8.10 (kernel 4.18.0-553) and confirmed working
with all kprobes, tracepoint, and CSV output.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 13:23:55 -04:00
..