From 0b29354e1ddf6cf75ac4c426a00dd3435ace5069 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 10 Nov 2026 11:08:49 -0300 Subject: ztrace: the event, the ring, the recording, a ptrace loop 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. --- targets/fib.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 targets/fib.c (limited to 'targets/fib.c') diff --git a/targets/fib.c b/targets/fib.c new file mode 100644 index 0000000..5be9998 --- /dev/null +++ b/targets/fib.c @@ -0,0 +1,12 @@ +#include +#include + +static unsigned long fib(unsigned n) { + return n < 2 ? n : fib(n - 1) + fib(n - 2); +} + +int main(int argc, char **argv) { + unsigned n = argc > 1 ? (unsigned)atoi(argv[1]) : 10; + printf("fib(%u) = %lu\n", n, fib(n)); + return 0; +} -- cgit v1.3