| author | |
| committer | |
| log | c2ffce3206974adc0924992585359d28c1974d14 |
| tree | 009a25ae32a6325fbafa9919116188d5315cef84 |
| parent | cc75b7f652c7cd51cbfa6e3c7e8155cd153bb68b |
4 files changed, 15 insertions(+), 8 deletions(-)
licenses.txt+4| ... | ... | @@ -2,3 +2,7 @@ MIT: |
| 2 | 2 | = https://spdx.org/licenses/MIT |
| 3 | 3 | - This |
| 4 | 4 | - git https://github.com/nektro/zig-extras |
| 5 | - git https://github.com/nektro/zig-sys-linux | |
| 6 | ||
| 7 | Unspecified: | |
| 8 | - system_lib c |
src/chrome.zig+5-4| ... | ... | @@ -3,15 +3,16 @@ const tracer = @import("./mod.zig"); |
| 3 | 3 | const alloc = std.heap.c_allocator; |
| 4 | 4 | const log = std.log.scoped(.tracer); |
| 5 | 5 | const root = @import("root"); |
| 6 | const linux = @import("sys-linux"); | |
| 6 | 7 | |
| 7 | var pid: std.os.linux.pid_t = undefined; | |
| 8 | threadlocal var tid: std.os.linux.pid_t = undefined; | |
| 8 | var pid: linux.pid_t = undefined; | |
| 9 | threadlocal var tid: linux.pid_t = undefined; | |
| 9 | 10 | threadlocal var path: []const u8 = undefined; |
| 10 | 11 | threadlocal var file: std.fs.File = undefined; |
| 11 | 12 | threadlocal var buffered_writer: std.io.BufferedWriter(4096, std.fs.File.Writer) = undefined; |
| 12 | 13 | |
| 13 | 14 | pub fn init() !void { |
| 14 | pid = std.os.linux.getpid(); | |
| 15 | pid = linux.getpid(); | |
| 15 | 16 | } |
| 16 | 17 | |
| 17 | 18 | pub fn deinit() void { |
| ... | ... | @@ -19,7 +20,7 @@ pub fn deinit() void { |
| 19 | 20 | } |
| 20 | 21 | |
| 21 | 22 | pub fn init_thread(dir: std.fs.Dir) !void { |
| 22 | tid = std.os.linux.gettid(); | |
| 23 | tid = linux.gettid(); | |
| 23 | 24 | |
| 24 | 25 | path = try std.fmt.allocPrint(alloc, "trace.{d}.{d}.chrome.json", .{ pid, tid }); |
| 25 | 26 | file = try dir.createFile(path, .{}); |
src/spall.zig+5-4| ... | ... | @@ -3,15 +3,16 @@ const tracer = @import("./mod.zig"); |
| 3 | 3 | const alloc = std.heap.c_allocator; |
| 4 | 4 | const log = std.log.scoped(.tracer); |
| 5 | 5 | const root = @import("root"); |
| 6 | const linux = @import("sys-linux"); | |
| 6 | 7 | |
| 7 | var pid: std.os.linux.pid_t = undefined; | |
| 8 | threadlocal var tid: std.os.linux.pid_t = undefined; | |
| 8 | var pid: linux.pid_t = undefined; | |
| 9 | threadlocal var tid: linux.pid_t = undefined; | |
| 9 | 10 | threadlocal var path: []const u8 = undefined; |
| 10 | 11 | threadlocal var file: std.fs.File = undefined; |
| 11 | 12 | threadlocal var buffered_writer: std.io.BufferedWriter(4096, std.fs.File.Writer) = undefined; |
| 12 | 13 | |
| 13 | 14 | pub fn init() !void { |
| 14 | pid = std.os.linux.getpid(); | |
| 15 | pid = linux.getpid(); | |
| 15 | 16 | } |
| 16 | 17 | |
| 17 | 18 | pub fn deinit() void { |
| ... | ... | @@ -19,7 +20,7 @@ pub fn deinit() void { |
| 19 | 20 | } |
| 20 | 21 | |
| 21 | 22 | pub fn init_thread(dir: std.fs.Dir) !void { |
| 22 | tid = std.os.linux.gettid(); | |
| 23 | tid = linux.gettid(); | |
| 23 | 24 | |
| 24 | 25 | path = try std.fmt.allocPrint(alloc, "{d}.{d}.spall", .{ pid, tid }); |
| 25 | 26 | file = try dir.createFile(path, .{}); |
zigmod.yml+1| ... | ... | @@ -5,3 +5,4 @@ license: MIT |
| 5 | 5 | description: Generic tracing library for Zig, supports multiple backends. |
| 6 | 6 | dependencies: |
| 7 | 7 | - src: git https://github.com/nektro/zig-extras |
| 8 | - src: git https://github.com/nektro/zig-sys-linux |