diff options
Diffstat (limited to 'src/agent/agent.zig')
| -rw-r--r-- | src/agent/agent.zig | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/agent/agent.zig b/src/agent/agent.zig index 22b4f8d..bc53336 100644 --- a/src/agent/agent.zig +++ b/src/agent/agent.zig @@ -66,7 +66,13 @@ pub fn init() void { if (client.getenv(env, "ZTRACE_HOOKS")) |list| { var specs = std.mem.tokenizeScalar(u8, list, ','); while (specs.next()) |spec| { - if (symbols.find(null, spec)) |function| hook.add(function.addr) else complain(&.{ "nothing called ", spec }); + const function = symbols.find(null, spec) orelse { + complain(&.{ "nothing called ", spec }); + continue; + }; + // A call names its callee by address: the string of that id is its name. + emit(.string, 0, .{ function.addr, 0, 0, 0, 0, 0 }, text(spec, max_payload)); + hook.add(function.addr); } } allocations = client.getenv(env, "ZTRACE_ALLOC") != null; |
