From 7f363779cb99b0820cce69c433bcfab87bb3d709 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 10 Nov 2026 11:32:21 -0300 Subject: event: what instrumentation puts in call, ret, line, variable, mem_write 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 --- src/trace/event.zig | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'src/trace/event.zig') diff --git a/src/trace/event.zig b/src/trace/event.zig index c24d7ac..4a9f6f7 100644 --- a/src/trace/event.zig +++ b/src/trace/event.zig @@ -24,9 +24,10 @@ pub const Kind = enum(u16) { thread_exit = 8, // Memory. - /// a0=addr a1=len. Payload: the bytes now at addr (len of them). + /// a0=addr a1=len. Payload: the bytes now at addr (len of them, or the + /// first of them: a backend may record a large write in part). mem_write = 16, - /// a0=addr a1=len a2=pc + /// a0=addr a1=len a2=pc (0: not given) mem_read = 17, /// a0=ptr a1=size a2=caller pc. aux: `Alloc`. A realloc that moves is a /// `free` of the old pointer, then this. @@ -39,17 +40,22 @@ pub const Kind = enum(u16) { unmap = 21, // Instrumentation (compiler passes, hooks). - /// a0=callee a1=call site a2=sp + /// a0=callee (the string id of its name, or its address when the + /// backend has no names) a1=call site a2=sp a3=string id of the + /// function's type description, if any call = 32, - /// a0=callee a1=return value + /// a0=callee a1=return value. aux: how many bytes of a1 are the value + /// (0: none, or not known) ret = 33, - /// a0=file string id a1=line a2=column a3=pc + /// a0=file string id a1=line a2=column a3=pc (0: not given) line = 34, /// a0=pc (a coverage edge) edge = 35, /// aux=operand bytes a0=pc a1=lhs a2=rhs cmp = 36, - /// A named variable comes alive: a0=addr a1=size a2=name string id a3=type string id + /// A named variable comes alive: a0=addr a1=size a2=name string id + /// a3=type string id (a description: src/instr/types.zig). aux: N for a + /// function's Nth parameter. variable = 37, // Kernel. -- cgit v1.3