summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
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.