diff --git a/build.zig b/build.zig index 4f50b5269984c3e48efc12cefffa9bec3305df82..5fc762b1231519000a3c868d6575e951ae166fec 100644 --- a/build.zig +++ b/build.zig @@ -14,13 +14,12 @@ pub fn build(b: *std.Build) void { addTest(b, target, mode, disable_llvm, mod, 3); const test_step = b.step("test", "Run all library tests"); - test_step.dependOn(b.default_step); + test_step.dependOn(b.getInstallStep()); } fn addTest(b: *std.Build, target: std.Build.ResolvedTarget, mode: std.builtin.Mode, disable_llvm: bool, mod: *std.Build.Module, comptime backend: u8) void { _ = mod; const options = b.addOptions(); - options.addOption(usize, "src_file_trimlen", std.fs.path.dirname(std.fs.path.dirname(@src().file).?).?.len); options.addOption(u8, "backend", backend); const exe = b.addExecutable(.{ diff --git a/src/chrome.zig b/src/chrome.zig index d8b2993ec721bb08c708ba55bec5cf73e8180ad3..3bf944c1506b4b05793dd7557fad79a44f4b5b3e 100644 --- a/src/chrome.zig +++ b/src/chrome.zig @@ -3,7 +3,6 @@ const tracer = @import("./mod.zig"); const alloc = std.heap.c_allocator; const log = std.log.scoped(.tracer); const root = @import("root"); -const trim_count = root.build_options.src_file_trimlen; var pid: std.os.linux.pid_t = undefined; threadlocal var tid: std.os.linux.pid_t = undefined; @@ -40,12 +39,12 @@ pub fn deinit_thread() void { pub inline fn trace_begin(ctx: tracer.Ctx, comptime ifmt: []const u8, iargs: anytype) void { buffered_writer.writer().print( \\{{"cat":"function", "name":"{s}:{d}:{d} ({s}) - ++ ifmt ++ - \\", "ph": "B", "pid": {d}, "tid": {d}, "ts": {d}}}, - \\ + ++ ifmt ++ + \\", "ph": "B", "pid": {d}, "tid": {d}, "ts": {d}}}, + \\ , .{ - if (ctx.src.file[0] == '/') ctx.src.file[trim_count..] else ctx.src.file, + ctx.src.file, ctx.src.line, ctx.src.column, ctx.src.fn_name, diff --git a/src/spall.zig b/src/spall.zig index 4168f67a33d0ae8e5cc29fdee9a61b62d27e2c5f..e2396dbec9bf4a07acb04db20cbe184a92e4cac0 100644 --- a/src/spall.zig +++ b/src/spall.zig @@ -3,7 +3,6 @@ const tracer = @import("./mod.zig"); const alloc = std.heap.c_allocator; const log = std.log.scoped(.tracer); const root = @import("root"); -const trim_count = root.build_options.src_file_trimlen; var pid: std.os.linux.pid_t = undefined; threadlocal var tid: std.os.linux.pid_t = undefined; @@ -38,12 +37,7 @@ pub fn deinit_thread() void { pub inline fn trace_begin(ctx: tracer.Ctx, comptime ifmt: []const u8, iargs: anytype) void { const fmt = "{s}:{d}:{d} ({s})" ++ ifmt; - const args = .{ - if (ctx.src.file[0] == '/') ctx.src.file[trim_count..] else ctx.src.file, - ctx.src.line, - ctx.src.column, - ctx.src.fn_name, - }; + const args = .{ ctx.src.file, ctx.src.line, ctx.src.column, ctx.src.fn_name }; buffered_writer.writer().writeStruct(BeginEvent{ .pid = @intCast(pid), .tid = @intCast(tid),