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);...@@ -5,6 +5,7 @@ const log = std.log.scoped(.tracer);
5const root = @import("root");5const root = @import("root");
6const nfs = @import("nfs");6const nfs = @import("nfs");
7const nio = @import("nio");7const nio = @import("nio");
8const time = @import("time");
8const linux = @import("sys-linux");9const linux = @import("sys-linux");
910
10var pid: linux.pid_t = undefined;11var pid: linux.pid_t = undefined;
...@@ -54,7 +55,7 @@ pub inline fn trace_begin(ctx: tracer.Ctx, comptime ifmt: []const u8, iargs: any...@@ -54,7 +55,7 @@ pub inline fn trace_begin(ctx: tracer.Ctx, comptime ifmt: []const u8, iargs: any
54 } ++ iargs ++ .{55 } ++ iargs ++ .{
55 pid,56 pid,
56 tid,57 tid,
57 std.time.microTimestamp(),58 time.microTimestamp(),
58 },59 },
59 ) catch {};60 ) catch {};
60}61}
...@@ -68,7 +69,7 @@ pub inline fn trace_end(ctx: tracer.Ctx) void {...@@ -68,7 +69,7 @@ pub inline fn trace_end(ctx: tracer.Ctx) void {
68 .{69 .{
69 pid,70 pid,
70 tid,71 tid,
71 std.time.microTimestamp(),72 time.microTimestamp(),
72 },73 },
73 ) catch {};74 ) catch {};
74}75}
src/spall.zig+3-2
...@@ -5,6 +5,7 @@ const log = std.log.scoped(.tracer);...@@ -5,6 +5,7 @@ const log = std.log.scoped(.tracer);
5const root = @import("root");5const root = @import("root");
6const nfs = @import("nfs");6const nfs = @import("nfs");
7const nio = @import("nio");7const nio = @import("nio");
8const time = @import("time");
8const linux = @import("sys-linux");9const linux = @import("sys-linux");
910
10var pid: linux.pid_t = undefined;11var pid: linux.pid_t = undefined;
...@@ -44,7 +45,7 @@ pub inline fn trace_begin(ctx: tracer.Ctx, comptime ifmt: []const u8, iargs: any...@@ -44,7 +45,7 @@ pub inline fn trace_begin(ctx: tracer.Ctx, comptime ifmt: []const u8, iargs: any
44 buffered_writer.writeStruct(BeginEvent{45 buffered_writer.writeStruct(BeginEvent{
45 .pid = @intCast(pid),46 .pid = @intCast(pid),
46 .tid = @intCast(tid),47 .tid = @intCast(tid),
47 .time = @floatFromInt(std.time.microTimestamp()),48 .time = @floatFromInt(time.microTimestamp()),
48 .name_len = @truncate(std.fmt.count(fmt, args ++ iargs)),49 .name_len = @truncate(std.fmt.count(fmt, args ++ iargs)),
49 .args_len = 0,50 .args_len = 0,
50 }) catch return;51 }) catch return;
...@@ -56,7 +57,7 @@ pub inline fn trace_end(ctx: tracer.Ctx) void {...@@ -56,7 +57,7 @@ pub inline fn trace_end(ctx: tracer.Ctx) void {
56 buffered_writer.writeStruct(EndEvent{57 buffered_writer.writeStruct(EndEvent{
57 .pid = @intCast(pid),58 .pid = @intCast(pid),
58 .tid = @intCast(tid),59 .tid = @intCast(tid),
59 .time = @floatFromInt(std.time.microTimestamp()),60 .time = @floatFromInt(time.microTimestamp()),
60 }) catch return;61 }) catch return;
61}62}
6263
zigmod.yml+1
...@@ -8,6 +8,7 @@ dependencies:...@@ -8,6 +8,7 @@ dependencies:
8 - src: git https://github.com/nektro/zig-sys-linux8 - src: git https://github.com/nektro/zig-sys-linux
9 - src: git https://github.com/nektro/zig-nfs9 - src: git https://github.com/nektro/zig-nfs
10 - src: git https://github.com/nektro/zig-nio10 - src: git https://github.com/nektro/zig-nio
11 - src: git https://github.com/nektro/zig-time
1112
12root_dependencies:13root_dependencies:
13 - src: git https://github.com/nektro/zig-nfs14 - src: git https://github.com/nektro/zig-nfs