summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-10 23:34:16 -0300
committerGabriel Schneider <[email protected]>2026-11-10 23:36:18 -0300
commit2a46b60e1d115ff5149a112bc0f800467c0efaee (patch)
tree50a700c33d20b4f7aa078d67c928a68d3e3f7c5f /src
parent2a97030c9743d4680d698414c28e8d8739614215 (diff)
downloadcomputeranim-2a46b60e1d115ff5149a112bc0f800467c0efaee.tar.gz
computeranim-2a46b60e1d115ff5149a112bc0f800467c0efaee.zip
record: --steps counts from the --from place
The loader's syscalls on the way to main used up the count: --steps 120 on a dynamic program left ninety instructions. Co-Authored-By: Claude Fable 5.2 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNCKgYCGiANnEwcEQxa
Diffstat (limited to 'src')
-rw-r--r--src/cli/record.zig7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/cli/record.zig b/src/cli/record.zig
index d3d7a64..6743ec4 100644
--- a/src/cli/record.zig
+++ b/src/cli/record.zig
@@ -44,7 +44,8 @@ pub const usage =
\\tcache, and the links of every chunk on a list; at most 4096 chunks and
\\256 entries a list. glibc 2.40 and 2.44 only, linked dynamically or
\\statically; the main arena's heap, the stopped thread's tcache.
- \\--steps ends the recording after N moments, and --max-size when the
+ \\--steps ends the recording after N moments (N stops from the --from
+ \\place, when there is one), and --max-size when the
\\file is that large (default 1G). Sizes take a suffix: 64K, 4G.
\\
++ util.Producer.usage;
@@ -188,7 +189,9 @@ pub fn run(init: std.process.Init, args: []const [:0]const u8) !void {
var timer = zt.event.now();
var exit_code: u64 = 0;
var full = false;
- while (rec.moments < max_moments) {
+ // From a place on, --steps counts the stops from there: what was recorded on the way is not of them.
+ var stops: u64 = 0;
+ while (if (from != null) stops < max_moments else rec.moments < max_moments) : (stops += 1) {
const stop = (if (entry) |id| stop: {
entry = null;
break :stop runTo(&d, id);