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/cli/main.zig | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/cli/main.zig') diff --git a/src/cli/main.zig b/src/cli/main.zig index 9e6b0e5..554efde 100644 --- a/src/cli/main.zig +++ b/src/cli/main.zig @@ -8,6 +8,7 @@ const commands = .{ .dbg = @import("dbg.zig"), .run = @import("run.zig"), .perf = @import("perf.zig"), + .probe = @import("probe.zig"), .dump = @import("dump.zig"), .show = @import("show.zig"), .cc = @import("cc.zig"), @@ -20,6 +21,7 @@ const usage = \\ dbg debug a program, recording it: step, break, look, go back \\ run record a program that carries a ring producer (agent, instrumentation) \\ perf record what the kernel sees of a program at full speed (perf events) + \\ probe ... with BPF programs on syscalls, scheduling, kprobes, uprobes, USDT (root) \\ dump print a recording's events \\ show print a recording's summary, or the program's state at a moment \\ cc compile a program with instrumentation that records it -- cgit v1.3