feat(ebpf): Add file, network, memory, and process-control syscall telemetry - #730
Merged
rabbitstack merged 5 commits intoSep 15, 2026
Merged
Conversation
Extend the Linux event catalog with openat, unlink, rename, connect, accept, mmap, process_vm_readv/writev, kill, ptrace, and prctl. Identifiers stay stable and Linux-native, and tests assert that Windows event names stay out of the catalog.
Grow the ring buffer record with extra arguments, a second path buffer, and truncation bits so later syscall families can share one header. Build scratch values in a per-CPU heap to stay under the BPF stack limit, and gate emission with an enabled-type array keyed by stable event IDs rather than architecture syscall numbers.
Add one CO-RE program per family for openat/unlink/rename, connect/accept, mmap/process_vm_readv/writev, and kill/ptrace/prctl. Optional families follow the existing enable-fileio, enable-net, and enable-mem switches, process-control events stay on, and accept reads the peer address on syscall exit because the kernel fills it then.
Add a checked matrix that every Linux event type decodes with its documented parameters, plus mmap process-state and live open/rename/unlink/kill coverage on a real kernel.
rabbitstack
requested changes
Sep 15, 2026
tp_btf/sys_exit supplies pt_regs, so kill/ptrace/prctl no longer need an enter probe or scratch slot. Rename filename2 to aux, document the truncation bits and padding, and keep only file-backed mmaps in process state until munmap is hooked.
rabbitstack
approved these changes
Sep 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is the purpose of this PR / why it is needed?
Expands the Linux eBPF source beyond the process vertical slice to the MVP syscall matrix:
openat(withopen/openat2),unlink/unlinkat,rename/renameat/renameat2,connect,accept/accept4,mmap,process_vm_readv/process_vm_writev,kill/tkill/tgkill,ptrace, andprctl. Each family lives in its own BPF program object sharing the ring buffer, scratch, and enabled-type maps throughMapReplacements.The shared
syscall_eventrecord grows generic argument slots, a second path buffer, and truncation bits. Enter-state is staged in a per-CPU heap array (two 256-byte paths exceed the BPF stack) and correlated to the exit through a global LRU hash keyed by pid_tgid: the task can migrate CPUs mid-syscall, so the correlation map cannot be per-CPU, and LRU eviction reclaims entries whose exit never fires. Sockaddr copies clamp to the caller's addrlen because a fixed-size read past the buffer can cross into an unmapped page and fail wholesale; accept reads the value-result addrlen and peer address at exit. Emission is gated in the kernel by an enabled-type array populated from the event source config, so disabled families cost neither ring buffer traffic nor userspace decode.Successful
mmapcalls update the process state with the new mapping (base, size, protection, anonymous or file-backed kind).What type of change does this PR introduce?
/kind feature
Any specific area of the project related to this PR?
/area instrumentation
/area telemetry
/area tests
Special notes for the reviewer
linux-port, notmaster.openat/openat2/openall map to oneopenatevent.kill,ptrace,prctl) are always captured with the process family. File, network, and memory families followenable-fileio,enable-net, andenable-mem, enforced twice: tracepoints are not attached, and the kernel-side enabled map stays zero.open,unlink,rename,tkill, and the existingfork/vfork) are optional attachments, following the earlier finding that some kernels refuse perf links on them. Modern variants (openat2,renameat2,accept4,tgkill) must attach../internal/ebpf/generate.shfollowed by a cleangit diff -- internal/ebpfgo test ./internal/ebpf/... ./pkg/event/...openat,rename,unlink, andkillend to end.Does this PR introduce a user-facing change?
Yes. On a 5.9+ kernel with runtime BTF,
fibratus runnow emits file, network, memory, and process-control syscall events alongside process telemetry, honoring theenable-fileio,enable-net, andenable-memevent source settings.