| ... | ... | @@ -2,13 +2,26 @@ const std = @import("std"); |
| 2 | 2 | const root = @import("root"); |
| 3 | 3 | const extras = @import("extras"); |
| 4 | 4 | const nfs = @import("nfs"); |
| 5 | | const impl = extras.globalOption("tracer_impl", type) orelse none; |
| 5 | const backend: Backend = extras.globalOption("tracer_backend", Backend) orelse .none; |
| 6 | const impl = switch (backend) { |
| 7 | .none => none, |
| 8 | .log => log, |
| 9 | .chrome => chrome, |
| 10 | .spall => spall, |
| 11 | }; |
| 6 | 12 | |
| 7 | 13 | pub const none = @import("./none.zig"); |
| 8 | 14 | pub const log = @import("./log.zig"); |
| 9 | 15 | pub const chrome = @import("./chrome.zig"); |
| 10 | 16 | pub const spall = @import("./spall.zig"); |
| 11 | 17 | |
| 18 | pub const Backend = enum { |
| 19 | none, |
| 20 | log, |
| 21 | chrome, |
| 22 | spall, |
| 23 | }; |
| 24 | |
| 12 | 25 | pub fn init(args: @typeInfo(@TypeOf(impl.init)).@"fn".params[0].type.?) !void { |
| 13 | 26 | try impl.init(args); |
| 14 | 27 | } |