From b426a8a99bcad81ecbb41d1f2a2e83738c29d8e1 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 10 Nov 2026 11:32:21 -0300 Subject: llvm: a pass that instruments for animation, its runtime, ztrace cc llvm/pass.cpp is an LLVM pass plugin: lines, stores, loads, calls and variables, each call into the runtime carrying names and type descriptions, selected by globs (-ztrace-only, -ztrace-mem), before the optimizer by default. src/instr/rt.zig is the runtime (libztrace-rt.a), which also answers clang's own coverage and -finstrument-functions hooks; src/instr/types.zig the grammar of the type descriptions and its parser. ztrace cc adds all of it to a compiler command. test-llvm compiles fib, two sorts, a linked list and a BFS through ztrace cc and asserts on their recordings; bench-llvm measures what each selection costs. 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 72b894a..1ac019f 100644 --- a/src/cli/main.zig +++ b/src/cli/main.zig @@ -9,6 +9,7 @@ const commands = .{ .run = @import("run.zig"), .dump = @import("dump.zig"), .show = @import("show.zig"), + .cc = @import("cc.zig"), }; const usage = @@ -19,6 +20,7 @@ const usage = \\ run record a program that carries a ring producer (agent, instrumentation) \\ 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 \\ \\`ztrace COMMAND --help` for each. \\ -- cgit v1.3