From 297943b01e18bb3d1dd41a8d3e220811de25228b Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 10 Nov 2026 11:49:22 -0300 Subject: ztrace probe: BPF on syscalls, scheduling, kprobes, uprobes and USDT Programs built as instruction arrays for one process (no compiler, no libbpf), writing Events into a BPF ring buffer; a drop counter in a map; task_struct offsets from the kernel's BTF; a USDT probe's arguments read in the kernel at the probe. Without CAP_BPF and CAP_PERFMON it says so; --dry-run builds and lists everything. Tested offline by running the programs in a small BPF machine, and for real by test-kernel-vm, which boots this kernel in QEMU where we are root. ztrace perf: moments are no longer cut per event unless --cut; --max-size, and a full recording stops the target and says so. perf.Sorted merges two backends' events by time. Co-Authored-By: Claude Fable 5.2 --- src/trace/root.zig | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/trace/root.zig') diff --git a/src/trace/root.zig b/src/trace/root.zig index 80745cb..62a7a90 100644 --- a/src/trace/root.zig +++ b/src/trace/root.zig @@ -20,6 +20,8 @@ pub const host = @import("host.zig"); pub const perf = @import("perf.zig"); /// Static probes (the ELF notes of ) and their arguments. pub const usdt = @import("usdt.zig"); +/// The kernel's view, privileged: BPF on tracepoints, kprobes, uprobes, USDT. +pub const bpf = @import("bpf.zig"); test { _ = event; @@ -33,4 +35,5 @@ test { _ = host; _ = perf; _ = usdt; + _ = bpf; } -- cgit v1.3