Skip to content

chore(ebpf): Add Linux CO-RE eBPF feasibility spike - #717

Open
mostafa wants to merge 5 commits into
rabbitstack:masterfrom
mostafa:feat/linux-ebpf-spike
Open

chore(ebpf): Add Linux CO-RE eBPF feasibility spike#717
mostafa wants to merge 5 commits into
rabbitstack:masterfrom
mostafa:feat/linux-ebpf-spike

Conversation

@mostafa

@mostafa mostafa commented Aug 5, 2026

Copy link
Copy Markdown

What is the purpose of this PR / why it is needed?

Validates that Fibratus can load CO-RE eBPF programs on Linux with the hard runtime contract needed for a future eBPF event source: kernel >=5.9, usable /sys/kernel/btf/vmlinux, ring buffers, and iter/task process baseline capture without bpf_d_path. The spike also proves shared-map replacement across separately generated objects, best-effort /proc enrichment, and race-safe startup reconciliation keyed by PID + start boot time. A feasibility note audits Windows coupling and every ps.Snapshotter consumer that must move before a Linux build can land.

What type of change does this PR introduce?


/kind improvement

Any specific area of the project related to this PR?


/area instrumentation

/area deps

/area build

Special notes for the reviewer


  • Throwaway spike lives under internal/ebpf/spike with committed bpf2go artifacts. Ordinary builds do not require clang; regenerate with internal/ebpf/spike/generate.sh.
  • Runtime probe helpers are in internal/ebpf.ProbePrerequisites. iter/task attach remains the conclusive iterator check inside the spike runner.
  • Validated in a privileged Docker Desktop LinuxKit 6.12 container with kernel BTF and tracefs mounted. Example successful run showed pending hot events queued during baseline and replayed (pending_queued/replay_applied > 0).
  • No Fibratus CLI/runtime behavior changes on Windows.

How to reproduce the spike:

# privileged Linux host/container with /sys/kernel/btf/vmlinux and tracefs
go test ./internal/ebpf -count=1
SPIKE_DURATION=1s go run ./internal/ebpf/spike/cmd/spike

Does this PR introduce a user-facing change?


No.

mostafa added 5 commits August 5, 2026 21:52
Pull in cilium/ebpf v0.20.0 for the Linux CO-RE instrumentation spike and future event source work.
Encode the hard Linux runtime contract (kernel >=5.9, runtime BTF, ringbuf, tracing/iter support) and prototype ProcessKey-based startup reconciliation with bounded pending-queue and drop metrics.
Prove sched_process_exec ringbuf capture, iter/task baseline without bpf_d_path, shared-map replacement across separately generated objects, best-effort /proc enrichment, and race-safe startup on a real kernel.
Record validated runtime/tooling prerequisites, spike proofs, Windows coupling hotspots, and the ps.Snapshotter consumer migration needed for a Linux build.
Ignore late iterator snapshots after live switch, avoid double-closing MapReplacement-owned maps, and back off on persistent ringbuf read errors.
@mostafa
mostafa force-pushed the feat/linux-ebpf-spike branch from c1cf6ef to 7f4086c Compare August 5, 2026 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant