From db923fa823354270217362db06356f2b1a41315e Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 10 Nov 2026 11:39:20 -0300 Subject: ztrace perf: the kernel's view of a program, unprivileged perf_event_open on a held child: counters, a sampling profile, every page fault with its registers, maps, threads, context switches, every syscall (the per-syscall tracepoints, the only ones open to a user), and the debug registers as watchpoints and breakpoints that do not stop the target. One time-ordered stream of Events into a Sink; --threads follows with a ring per CPU. usdt.zig: the notes of and their arguments from a Regs and a memory reader, independent of BPF. test-kernel runs all of it on targets/kernel_*. 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 1ac019f..9e6b0e5 100644 --- a/src/cli/main.zig +++ b/src/cli/main.zig @@ -7,6 +7,7 @@ const commands = .{ .record = @import("record.zig"), .dbg = @import("dbg.zig"), .run = @import("run.zig"), + .perf = @import("perf.zig"), .dump = @import("dump.zig"), .show = @import("show.zig"), .cc = @import("cc.zig"), @@ -18,6 +19,7 @@ const usage = \\ record run a program under ptrace into a recording \\ 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) \\ 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