diff options
Diffstat (limited to 'build.zig')
| -rw-r--r-- | build.zig | 20 |
1 files changed, 19 insertions, 1 deletions
@@ -109,6 +109,24 @@ pub fn build(b: *std.Build) void { shown.addArg("show"); shown.addFileArg(recording); inline for (.{ "6 breakpoint", "5 alloc", "7 call", "7 ret", " variable", " line" }) |part| shown.expectStdOutMatch(part); - ctx.areaTest("test-together", "A debugger, the agent and instrumentation on one program").dependOn(&shown.step); + const both = ctx.areaTest("test-together", "The backends on one program, in one recording"); + both.dependOn(&shown.step); + + // ... and the kernel's view with the program's own: a list's + // allocations among the page faults of the heap they grow. + const seen = b.addRunArtifact(exe); + seen.addArgs(&.{ "perf", "--faults", "--alloc", "--preload" }); + seen.addArtifactArg(agent); + seen.addArg("-o"); + const kernel_and_own = seen.addOutputFileArg("perf-agent.ztrace"); + seen.addArg("--"); + seen.addArtifactArg(ctx.cTarget("agent_list", &.{"agent_list.c"})); + seen.addArg("100"); + seen.expectStdErrMatch("(0 lost)"); + const listed = b.addRunArtifact(exe); + listed.addArg("show"); + listed.addFileArg(kernel_and_own); + inline for (.{ " alloc", " free", " fault", " map" }) |part| listed.expectStdOutMatch(part); + both.dependOn(&listed.step); @import("build/kernel.zig").add(ctx); } |
