| ... | @@ -63,44 +63,40 @@ pub const Ctx = if (enable) ___tracy_c_zone_context else struct { | ... | @@ -63,44 +63,40 @@ pub const Ctx = if (enable) ___tracy_c_zone_context else struct { |
| 63 | pub inline fn trace(comptime src: std.builtin.SourceLocation) Ctx { | 63 | pub inline fn trace(comptime src: std.builtin.SourceLocation) Ctx { |
| 64 | if (!enable) return .{}; | 64 | if (!enable) return .{}; |
| 65 | | 65 | |
| 66 | if (enable_callstack) { | 66 | const global = struct { |
| 67 | return ___tracy_emit_zone_begin_callstack(&.{ | 67 | const loc: ___tracy_source_location_data = .{ |
| 68 | .name = null, | 68 | .name = null, |
| 69 | .function = src.fn_name.ptr, | 69 | .function = src.fn_name.ptr, |
| 70 | .file = src.file.ptr, | 70 | .file = src.file.ptr, |
| 71 | .line = src.line, | 71 | .line = src.line, |
| 72 | .color = 0, | 72 | .color = 0, |
| 73 | }, callstack_depth, 1); | 73 | }; |
| | 74 | }; |
| | 75 | |
| | 76 | if (enable_callstack) { |
| | 77 | return ___tracy_emit_zone_begin_callstack(&global.loc, callstack_depth, 1); |
| 74 | } else { | 78 | } else { |
| 75 | return ___tracy_emit_zone_begin(&.{ | 79 | return ___tracy_emit_zone_begin(&global.loc, 1); |
| 76 | .name = null, | | |
| 77 | .function = src.fn_name.ptr, | | |
| 78 | .file = src.file.ptr, | | |
| 79 | .line = src.line, | | |
| 80 | .color = 0, | | |
| 81 | }, 1); | | |
| 82 | } | 80 | } |
| 83 | } | 81 | } |
| 84 | | 82 | |
| 85 | pub inline fn traceNamed(comptime src: std.builtin.SourceLocation, comptime name: [:0]const u8) Ctx { | 83 | pub inline fn traceNamed(comptime src: std.builtin.SourceLocation, comptime name: [:0]const u8) Ctx { |
| 86 | if (!enable) return .{}; | 84 | if (!enable) return .{}; |
| 87 | | 85 | |
| 88 | if (enable_callstack) { | 86 | const global = struct { |
| 89 | return ___tracy_emit_zone_begin_callstack(&.{ | 87 | const loc: ___tracy_source_location_data = .{ |
| 90 | .name = name.ptr, | 88 | .name = name.ptr, |
| 91 | .function = src.fn_name.ptr, | 89 | .function = src.fn_name.ptr, |
| 92 | .file = src.file.ptr, | 90 | .file = src.file.ptr, |
| 93 | .line = src.line, | 91 | .line = src.line, |
| 94 | .color = 0, | 92 | .color = 0, |
| 95 | }, callstack_depth, 1); | 93 | }; |
| | 94 | }; |
| | 95 | |
| | 96 | if (enable_callstack) { |
| | 97 | return ___tracy_emit_zone_begin_callstack(&global.loc, callstack_depth, 1); |
| 96 | } else { | 98 | } else { |
| 97 | return ___tracy_emit_zone_begin(&.{ | 99 | return ___tracy_emit_zone_begin(&global.loc, 1); |
| 98 | .name = name.ptr, | | |
| 99 | .function = src.fn_name.ptr, | | |
| 100 | .file = src.file.ptr, | | |
| 101 | .line = src.line, | | |
| 102 | .color = 0, | | |
| 103 | }, 1); | | |
| 104 | } | 100 | } |
| 105 | } | 101 | } |
| 106 | | 102 | |