authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-04-26 16:54:52 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-04-27 20:59:44 -07:00
logccbff4bf3ad50eaba9a89f8dffbd37fd8b5099ad
tree85b5aa984cec1228d68cbdf74f7bdf132c893044
parent1a7c4e85025b8fff061f78ff34f7524bbed2722d
signaturebadge-check Signed by SSH key SHA256:4hHJbtBRU58AYXwjL7fkz2fnQHdiye8x1QpTCQ0sHNw

migrate to zig-time


3 files changed, 7 insertions(+), 4 deletions(-)

src/chrome.zig+3-2
......@@ -5,6 +5,7 @@ const log = std.log.scoped(.tracer);
55const root = @import("root");
66const nfs = @import("nfs");
77const nio = @import("nio");
8const time = @import("time");
89const linux = @import("sys-linux");
910
1011var pid: linux.pid_t = undefined;
......@@ -54,7 +55,7 @@ pub inline fn trace_begin(ctx: tracer.Ctx, comptime ifmt: []const u8, iargs: any
5455 } ++ iargs ++ .{
5556 pid,
5657 tid,
57 std.time.microTimestamp(),
58 time.microTimestamp(),
5859 },
5960 ) catch {};
6061}
......@@ -68,7 +69,7 @@ pub inline fn trace_end(ctx: tracer.Ctx) void {
6869 .{
6970 pid,
7071 tid,
71 std.time.microTimestamp(),
72 time.microTimestamp(),
7273 },
7374 ) catch {};
7475}
src/spall.zig+3-2
......@@ -5,6 +5,7 @@ const log = std.log.scoped(.tracer);
55const root = @import("root");
66const nfs = @import("nfs");
77const nio = @import("nio");
8const time = @import("time");
89const linux = @import("sys-linux");
910
1011var pid: linux.pid_t = undefined;
......@@ -44,7 +45,7 @@ pub inline fn trace_begin(ctx: tracer.Ctx, comptime ifmt: []const u8, iargs: any
4445 buffered_writer.writeStruct(BeginEvent{
4546 .pid = @intCast(pid),
4647 .tid = @intCast(tid),
47 .time = @floatFromInt(std.time.microTimestamp()),
48 .time = @floatFromInt(time.microTimestamp()),
4849 .name_len = @truncate(std.fmt.count(fmt, args ++ iargs)),
4950 .args_len = 0,
5051 }) catch return;
......@@ -56,7 +57,7 @@ pub inline fn trace_end(ctx: tracer.Ctx) void {
5657 buffered_writer.writeStruct(EndEvent{
5758 .pid = @intCast(pid),
5859 .tid = @intCast(tid),
59 .time = @floatFromInt(std.time.microTimestamp()),
60 .time = @floatFromInt(time.microTimestamp()),
6061 }) catch return;
6162}
6263
zigmod.yml+1
......@@ -8,6 +8,7 @@ dependencies:
88 - src: git https://github.com/nektro/zig-sys-linux
99 - src: git https://github.com/nektro/zig-nfs
1010 - src: git https://github.com/nektro/zig-nio
11 - src: git https://github.com/nektro/zig-time
1112
1213root_dependencies:
1314 - src: git https://github.com/nektro/zig-nfs