From 8ac0639bfc0186acedb11759432a2cfa277193f2 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 10 Nov 2026 12:28:33 -0300 Subject: static probes from the debugger: -b usdt:PROVIDER:NAME, no root Debugger.usdt arms the USDT probes of every mapped module as breakpoints whose hook records a probe event with its arguments and lets the program run on, raising a probe's semaphore first; record and dbg take usdt:PROVIDER:NAME (* for any), running the loader through when the probe is a library's. glibc's own 78 probes are there for the asking: memory_sbrk_more shows malloc growing the heap. --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'README.md') diff --git a/README.md b/README.md index 922ab77..64a11be 100644 --- a/README.md +++ b/README.md @@ -109,6 +109,12 @@ ztrace perf --faults --syscalls --alloc --preload zig-out/lib/libztrace-agent.so zig build test-together ``` +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. +glibc ships 78 of them (`memory_sbrk_more`, `setjmp`, `lll_lock_wait`...); +`` puts your own into a program. + `--ring` (implied by `--preload` and `--alloc`) gives a target under ptrace the ring `ztrace run` gives it; the debugger drains it while the target runs and before it reports a stop. The agent's hooks and syscall -- cgit v1.3