summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* ring: a producer waiting for room is woken at half empty, not at every recordGabriel Schneider7 days
| | | | | | | | A full ring made consumer and producer trade a futex wake for every record: 2.8 M events/s through ztrace run where the recorder alone does 12 M. One comparison in advance. Co-Authored-By: Claude Fable 5.2 <[email protected]>
* agent: syscalls on a stack of the agent's, clones made inside the handler; ↵Gabriel Schneider7 days
| | | | | | | | | | | | | | | what a recording may hold Syscall User Dispatch now runs its handler on an alternate stack a thread (a thread's own stack may not hold a signal frame; node makes such threads), and makes clone, clone3 and vfork itself: the child leaves through the gate with the target's registers instead of being stepped into with the trap flag. Paths and written buffers are cut at 256 bytes (--capture), a watch or snapshot above 1 MiB is refused, and ztrace run ends a recording that is full (--max-size) with the target killed and the file closed. Co-Authored-By: Claude Fable 5.2 <[email protected]>
* agent: the in-process backend, and ztrace run's options for itGabriel Schneider7 days
| | | | | | | | | | | | | | libztrace-agent.so (preloaded) and libztrace-agent.a (linked in), one source: map and thread_start at startup; alloc/free from the interposed allocator; syscall_enter/exit through Syscall User Dispatch; call/ret from int3 hooks; mem_write from watched regions diffed in-process; the target-side API (include/ztrace.h, and the ztrace-agent module for Zig). ztrace run turns each on (--alloc --syscalls --hook --watch), chooses the moments (--cut), and stops the target at event kinds without ptrace (--stop-at, --read, -i). test-agent records real targets and checks the recordings. Co-Authored-By: Claude Fable 5.2 <[email protected]>
* client: a thread's id asked once, the environment read by nameGabriel Schneider7 days
| | | | | | | | The gettid per event is gone (a thread-local cache; a forked child resets it), and environ/getenv are public: the agent reads its ZTRACE_* options the way the ring's fd was read. Co-Authored-By: Claude Fable 5.2 <[email protected]>
* ring: each side reads the other's counter only when its own view is used upGabriel Schneider7 days
| | | | | | The consumer cached nothing and re-read head for every record, the producers tail: the two cache lines bounced on each event. From the LLVM runtime's profile: an event through the ring 65 ns to 29 ns.
* README: compiled inGabriel Schneider7 days
| | | | Co-Authored-By: Claude Fable 5.2 <[email protected]>
* llvm: a pass that instruments for animation, its runtime, ztrace ccGabriel Schneider7 days
| | | | | | | | | | | | | | | | 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 <[email protected]>
* event: what instrumentation puts in call, ret, line, variable, mem_writeGabriel Schneider7 days
| | | | | | | | | Comments only: call's callee is a name's string id when the backend has names, a3 its type; ret's aux is the size of the value; a variable's aux its parameter number; a pc may be 0; a mem_write may hold the first bytes of a large write. Co-Authored-By: Claude Fable 5.2 <[email protected]>
* host: a stop mask set before the target startsGabriel Schneider7 days
| | | | | | | | Session.spawn stores Options.stop_mask in the ring before it forks, so a tracer that steps a target by its events is not racing the target's first one. Co-Authored-By: Claude Fable 5.2 <[email protected]>
* design: the visual system canim follows, with eight mock framesGabriel Schneider7 days
| | | | | | | Lapis page and vellum ink; a role is a form as well as a colour (current, write, read, pointer, allocated, freed, fault, kernel); panels as acme windows; Go Mono for the machine and Go for the narrator; motion as whole frames at 60 fps. design/mock/gen.py redraws the mocks from the tokens.
* build: C targets without UBSan, whose checks would be traced tooGabriel Schneider7 days
|
* README: the debuggerGabriel Schneider7 days
| | | | Co-Authored-By: Claude Fable 5.2 <[email protected]>
* targets, test-debugger, bench-debuggerGabriel Schneider7 days
| | | | | | | | | | | A linked list, a graph search in Zig, the same C under glibc and musl, two threads. The tests drive the debugger over them: breakpoint counts, the lines a step walks (as gdb), a list snapshotted by a hook, a watch's words, the syscalls that tell glibc from musl, threads, attach, and scripted dbg and record sessions. The bench measures steps, stops and memory access from bare ptrace up to a recording. Co-Authored-By: Claude Fable 5.2 <[email protected]>
* debugger: steps by instruction and line, breakpoints, hooks, watches, ↵Gabriel Schneider7 days
| | | | | | | | | | | | | | | | | | | threads; ztrace dbg ptrace.zig follows the threads a target makes, attaches, tells a step from a breakpoint, and writes memory in one call (through /proc/pid/mem where the page is read-only). Debugger.zig is the layer above: cont, stepi, step (a source line, through std.debug's DWARF), breakpoints with hooks, syscall stops and hooks with the path or buffer captured, watched regions sent as the words that changed, and every stop an event. Symbols.zig is modules, ELF symbols and line tables; syscalls.zig their names and shapes. ztrace dbg is a small REPL on it that records as it goes and looks back into the recording; ztrace record stops by instruction, line, syscall or breakpoint, prints syscalls as strace does, and ends cleanly when the recording is full. Co-Authored-By: Claude Fable 5.2 <[email protected]>
* canim is a package of its own, anim/: ztrace builds without sketchbook and ↵Gabriel Schneider7 days
| | | | pardes
* recorder: a moment is its events, state is at keyframesGabriel Schneider7 days
| | | | | | | | | | | | | | | | | | Folding every event into persistent state at every moment cost 750 bytes a step and 2 KB a scattered 8-byte write: the tree's path copied each time. Now a moment stores its events alone, in a compact code (a flags byte, varints, time as a difference, registers as the ones that changed), and the state (threads, memory, heap, variables, mappings, strings) is written at a keyframe a batch, sharing with the one before. A reader replays at most a batch over a keyframe, and keeps four positions replayed, so playing forward reads one moment a step. Of a memory write the recorder keeps the spans that differ from what it holds, so a region read again costs what changed in it. It stops at max_bytes (1 GiB). A step with registers: 749 bytes to 57. fib(12) by instruction, 142 000 moments: 111 MB to 8 MB, 197 000 moments/s. bench-store measures the rest.
* ring: a record larger than the ring is dropped and counted, not asserted onGabriel Schneider7 days
|
* ztrace show: a recording's summary, and the program's state at a momentGabriel Schneider7 days
|
* recorder: moments in batches, and the heap, the stack, variables, lines and ↵Gabriel Schneider7 days
| | | | | | | | | | | | | | | mappings in each A transaction a moment cost 10 µs and 1 KB before the moment's own data: the list's path copied each time. Moments now gather 256 to a transaction, each frozen by its own cursor so the list grows in place, and a thread's fields sit in the moment's map instead of two maps down: a small moment is 284 bytes and 1 µs, an instruction step with registers 780 bytes. A moment also folds alloc/free into the live heap, call/ret into each thread's stack, variable into the live variables (a local leaves with its call), line, and map/unmap, so a viewer reads any of them at any moment without replaying.
* ztrace: the event, the ring, the recording, a ptrace loopGabriel Schneider7 days
One 64-byte Event for every backend; a shared-memory ring from target to tracer with stop/resume; a Recorder that folds events into xitdb moments (registers, memory in 64-byte chunks with known-byte masks, strings) and a Trace that reads any moment back; a minimal ptrace Process; ztrace record, run and dump. Per-area build files so the areas grow apart.