summaryrefslogtreecommitdiff
path: root/build/kernel.zig
diff options
context:
space:
mode:
Diffstat (limited to 'build/kernel.zig')
-rw-r--r--build/kernel.zig15
1 files changed, 15 insertions, 0 deletions
diff --git a/build/kernel.zig b/build/kernel.zig
index aae593a..3a0c65c 100644
--- a/build/kernel.zig
+++ b/build/kernel.zig
@@ -30,6 +30,21 @@ pub fn add(ctx: Ctx) void {
// ... and the library's own tests of this area: what needs no target.
step.dependOn(&b.addRunArtifact(b.addTest(.{ .root_module = ctx.ztrace, .filters = &.{ "perf.test", "usdt.test", "bpf.test" } })).step);
+ // The static probes without root: the debugger stops at each for as
+ // long as it takes to record it. start, four ticks, done.
+ const probed = b.addRunArtifact(ctx.exe);
+ probed.addArgs(&.{ "record", "--by", "break", "-b", "usdt:ztrace:*", "-o" });
+ const probes = probed.addOutputFileArg("usdt.ztrace");
+ probed.addArg("--");
+ probed.addArtifactArg(targets[2]);
+ probed.addArg("4");
+ probed.expectStdErrMatch("exit 0");
+ const shown = b.addRunArtifact(ctx.exe);
+ shown.addArg("show");
+ shown.addFileArg(probes);
+ shown.expectStdOutMatch("6 probe");
+ step.dependOn(&shown.step);
+
// The BPF side for real: this machine's kernel booted in QEMU, where we
// are root. Not part of `test`: it wants qemu, /dev/kvm, cpio and a
// kernel image a user can read.