From a10e1691dbe5b944812dc8761a450636bc247e3d Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 10 Nov 2026 12:07:53 -0300 Subject: agent: bench-agent and its numbers, hooks with names, an archive cc can link zig build bench-agent runs each capability against its native loop and prints what it costs and writes; README has the table. ztrace run looks at the ring a little longer before sleeping (a target that finds the tracer asleep pays a futex wake an event). A hooked function's name is defined as the string of its address, so the recorder's call stack reads fib. A static link without libc's malloc says which -u to add. The archive carries no stack probes, so cc links it in debug builds too. Tests for --wrap (musl, zig cc) and for a recording that fills. Co-Authored-By: Claude Fable 5.2 --- include/ztrace.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/ztrace.h b/include/ztrace.h index fc6f263..1b7893c 100644 --- a/include/ztrace.h +++ b/include/ztrace.h @@ -8,6 +8,9 @@ * -Wl,--wrap=malloc,--wrap=calloc,--wrap=realloc,--wrap=free * -Wl,--wrap=posix_memalign,--wrap=aligned_alloc,--wrap=memalign * -Wl,--wrap=pthread_create,--wrap=fork + * and, when libc is linked statically too (glibc with -static), so that its + * own are still there to call: + * -Wl,-u,malloc,-u,pthread_create,-u,fork */ #ifndef ZTRACE_H #define ZTRACE_H -- cgit v1.3