diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-10 12:09:27 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-10 12:15:20 -0300 |
| commit | a7504c6bb2ec9e906891e42bc3df28b276e67143 (patch) | |
| tree | c13e680499badf341b17960341386b8199637671 /build/agent.zig | |
| parent | 937b6314c4cd6fa73daeac308fbfcf69b89add56 (diff) | |
| download | computeranim-a7504c6bb2ec9e906891e42bc3df28b276e67143.tar.gz computeranim-a7504c6bb2ec9e906891e42bc3df28b276e67143.zip | |
the backends together: a ring under the debugger, strings that do not collide
ztrace record and dbg take --ring, --preload and --alloc: the target gets
the ring ztrace run gives it, and the debugger drains it while the target
runs (polling for the stop, so a full ring cannot hold both) and before it
reports a stop. A program compiled by ztrace cc, with the agent preloaded,
stopped at breakpoints, is one recording in order; test-together checks it.
Recording such a program showed the debugger's file names and the pass's
strings both counted from 1: event.stringId (a hash, top bit set) is now
what every producer without a table of its own uses.
Diffstat (limited to 'build/agent.zig')
| -rw-r--r-- | build/agent.zig | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/build/agent.zig b/build/agent.zig index 3fea2e2..c1e1dcc 100644 --- a/build/agent.zig +++ b/build/agent.zig @@ -4,7 +4,8 @@ const std = @import("std"); const Ctx = @import("../build.zig").Ctx; const Compile = std.Build.Step.Compile; -pub fn add(ctx: Ctx) void { +/// Returns the library to preload, for what tests it with other backends. +pub fn add(ctx: Ctx) *Compile { const b = ctx.b; const imports: []const std.Build.Module.Import = &.{.{ .name = "ztrace", .module = ctx.ztrace }}; @@ -163,6 +164,7 @@ pub fn add(ctx: Ctx) void { } bench_step.dependOn(before.?); for ([_]*Compile{ api, api_static, api_zig }) |exe| b.installArtifact(exe); + return libs[0]; } const Recording = struct { run: *std.Build.Step.Run, file: std.Build.LazyPath }; |
