summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-10 15:16:02 -0300
committerGabriel Schneider <[email protected]>2026-11-10 15:17:21 -0300
commit2463e602f12f969fe085bc2114a3960411b79f87 (patch)
tree61decdd2971552e14f2bdf1be2376c83c349e21a /README.md
parentbe80d248f88137af29d32e36b9bbba6557f00100 (diff)
downloadcomputeranim-2463e602f12f969fe085bc2114a3960411b79f87.tar.gz
computeranim-2463e602f12f969fe085bc2114a3960411b79f87.zip
debugger: a variable the target declares is watched; the runtime has no debug info
Events from the target's ring pass a tap on their way to the sink: a variable declared there (the pass's --instr vars, the agent's ztrace_watch) joins the regions recorded at every stop. With nothing else instrumented that is names and types from the compiler, values and everything else from the debugger. The instrumentation runtime is built stripped, so stepping by line runs through its calls.
Diffstat (limited to 'README.md')
-rw-r--r--README.md13
1 files changed, 13 insertions, 0 deletions
diff --git a/README.md b/README.md
index 3e181ca..b9beb28 100644
--- a/README.md
+++ b/README.md
@@ -159,6 +159,19 @@ ztrace perf --faults --syscalls --alloc --preload zig-out/lib/libztrace-agent.so
zig build test-together
```
+The cleanest machine-level recording with names in it is `ztrace cc
+--instr vars` under the debugger: the pass declares each variable (name,
+type, address) and instruments nothing else, the debugger watches every
+variable declared through the ring and records its bytes at each stop, and
+the lines, registers, disassembly and memory touches are the debugger's
+own, of code that is otherwise the program's.
+
+```sh
+ztrace cc --instr vars -- clang -O0 targets/instr_sort.c -o sort
+ztrace record --by line --ring -- ./sort && ztrace show out.ztrace 140
+ unsorted: [8]i32 = 05 00 00 00 02 00 00 00 ... i: i32 = 02 00 00 00
+```
+
Static probes (USDT, DTrace's) need neither BPF nor root this way: `ztrace
record --by break -b 'usdt:libc:*' -- ./prog` arms each probe as a
breakpoint that records a `probe` event with its arguments and runs on.