| ... | @@ -9,7 +9,7 @@ pub const callstack_depth = if (enable_callstack and build_options.tracy_callsta | ... | @@ -9,7 +9,7 @@ pub const callstack_depth = if (enable_callstack and build_options.tracy_callsta |
| 9 | | 9 | |
| 10 | const ___tracy_c_zone_context = extern struct { | 10 | const ___tracy_c_zone_context = extern struct { |
| 11 | id: u32, | 11 | id: u32, |
| 12 | active: c_int, | 12 | active: i32, |
| 13 | | 13 | |
| 14 | pub inline fn end(self: @This()) void { | 14 | pub inline fn end(self: @This()) void { |
| 15 | ___tracy_emit_zone_end(self); | 15 | ___tracy_emit_zone_end(self); |
| ... | @@ -197,24 +197,22 @@ pub fn TracyAllocator(comptime name: ?[:0]const u8) type { | ... | @@ -197,24 +197,22 @@ pub fn TracyAllocator(comptime name: ?[:0]const u8) type { |
| 197 | | 197 | |
| 198 | // This function only accepts comptime-known strings, see `messageCopy` for runtime strings | 198 | // This function only accepts comptime-known strings, see `messageCopy` for runtime strings |
| 199 | pub inline fn message(comptime msg: [:0]const u8) void { | 199 | pub inline fn message(comptime msg: [:0]const u8) void { |
| 200 | if (!enable) return; | 200 | messageColor(msg, 0); |
| 201 | ___tracy_emit_messageL(msg.ptr, if (enable_callstack) callstack_depth else 0); | | |
| 202 | } | 201 | } |
| 203 | | 202 | |
| 204 | // This function only accepts comptime-known strings, see `messageColorCopy` for runtime strings | 203 | // This function only accepts comptime-known strings, see `messageColorCopy` for runtime strings |
| 205 | pub inline fn messageColor(comptime msg: [:0]const u8, color: u32) void { | 204 | pub inline fn messageColor(comptime msg: [:0]const u8, color: u24) void { |
| 206 | if (!enable) return; | 205 | if (!enable) return; |
| 207 | ___tracy_emit_messageLC(msg.ptr, color, if (enable_callstack) callstack_depth else 0); | 206 | ___tracy_emit_logStringL(.Info, color, if (enable_callstack) callstack_depth else 0, msg.ptr); |
| 208 | } | 207 | } |
| 209 | | 208 | |
| 210 | pub inline fn messageCopy(msg: []const u8) void { | 209 | pub inline fn messageCopy(msg: []const u8) void { |
| 211 | if (!enable) return; | 210 | messageColorCopy(msg, 0); |
| 212 | ___tracy_emit_message(msg.ptr, msg.len, if (enable_callstack) callstack_depth else 0); | | |
| 213 | } | 211 | } |
| 214 | | 212 | |
| 215 | pub inline fn messageColorCopy(msg: [:0]const u8, color: u32) void { | 213 | pub inline fn messageColorCopy(msg: []const u8, color: u24) void { |
| 216 | if (!enable) return; | 214 | if (!enable) return; |
| 217 | ___tracy_emit_messageC(msg.ptr, msg.len, color, if (enable_callstack) callstack_depth else 0); | 215 | ___tracy_emit_logString(.Info, color, if (enable_callstack) callstack_depth else 0, msg.len, msg.ptr); |
| 218 | } | 216 | } |
| 219 | | 217 | |
| 220 | pub inline fn frameMark() void { | 218 | pub inline fn frameMark() void { |
| ... | @@ -293,32 +291,32 @@ inline fn freeNamed(ptr: [*]u8, comptime name: [:0]const u8) void { | ... | @@ -293,32 +291,32 @@ inline fn freeNamed(ptr: [*]u8, comptime name: [:0]const u8) void { |
| 293 | } | 291 | } |
| 294 | } | 292 | } |
| 295 | | 293 | |
| 296 | extern fn ___tracy_emit_zone_begin( | 294 | pub const MessageSeverity = enum(i8) { |
| 297 | srcloc: *const ___tracy_source_location_data, | 295 | Trace, // Broadly track variable states and events in the software program. |
| 298 | active: c_int, | 296 | Debug, // Describes variable states and details about specific internal events in the software, that are useful for investigations. |
| 299 | ) ___tracy_c_zone_context; | 297 | Info, // Describes normal events, which inform on the expected progress and state of your software. |
| 300 | extern fn ___tracy_emit_zone_begin_callstack( | 298 | Warning, // Describes potentially dangerous situations caused by unexpected events and states. |
| 301 | srcloc: *const ___tracy_source_location_data, | 299 | Error, // Describes the occurance of unexpected behavior. Does not interrupt the execution of the software. |
| 302 | depth: c_int, | 300 | Fatal, // Describes a critical event that will lead to a software failure/crash. |
| 303 | active: c_int, | 301 | }; |
| 304 | ) ___tracy_c_zone_context; | 302 | |
| | 303 | extern fn ___tracy_emit_zone_begin(srcloc: *const ___tracy_source_location_data, active: i32) ___tracy_c_zone_context; |
| | 304 | extern fn ___tracy_emit_zone_begin_callstack(srcloc: *const ___tracy_source_location_data, depth: i32, active: i32) ___tracy_c_zone_context; |
| 305 | extern fn ___tracy_emit_zone_text(ctx: ___tracy_c_zone_context, txt: [*]const u8, size: usize) void; | 305 | extern fn ___tracy_emit_zone_text(ctx: ___tracy_c_zone_context, txt: [*]const u8, size: usize) void; |
| 306 | extern fn ___tracy_emit_zone_name(ctx: ___tracy_c_zone_context, txt: [*]const u8, size: usize) void; | 306 | extern fn ___tracy_emit_zone_name(ctx: ___tracy_c_zone_context, txt: [*]const u8, size: usize) void; |
| 307 | extern fn ___tracy_emit_zone_color(ctx: ___tracy_c_zone_context, color: u32) void; | 307 | extern fn ___tracy_emit_zone_color(ctx: ___tracy_c_zone_context, color: u32) void; |
| 308 | extern fn ___tracy_emit_zone_value(ctx: ___tracy_c_zone_context, value: u64) void; | 308 | extern fn ___tracy_emit_zone_value(ctx: ___tracy_c_zone_context, value: u64) void; |
| 309 | extern fn ___tracy_emit_zone_end(ctx: ___tracy_c_zone_context) void; | 309 | extern fn ___tracy_emit_zone_end(ctx: ___tracy_c_zone_context) void; |
| 310 | extern fn ___tracy_emit_memory_alloc(ptr: *const anyopaque, size: usize, secure: c_int) void; | 310 | extern fn ___tracy_emit_memory_alloc(ptr: *const anyopaque, size: usize, secure: i32) void; |
| 311 | extern fn ___tracy_emit_memory_alloc_callstack(ptr: *const anyopaque, size: usize, depth: c_int, secure: c_int) void; | 311 | extern fn ___tracy_emit_memory_alloc_callstack(ptr: *const anyopaque, size: usize, depth: i32, secure: i32) void; |
| 312 | extern fn ___tracy_emit_memory_free(ptr: *const anyopaque, secure: c_int) void; | 312 | extern fn ___tracy_emit_memory_free(ptr: *const anyopaque, secure: i32) void; |
| 313 | extern fn ___tracy_emit_memory_free_callstack(ptr: *const anyopaque, depth: c_int, secure: c_int) void; | 313 | extern fn ___tracy_emit_memory_free_callstack(ptr: *const anyopaque, depth: i32, secure: i32) void; |
| 314 | extern fn ___tracy_emit_memory_alloc_named(ptr: *const anyopaque, size: usize, secure: c_int, name: [*:0]const u8) void; | 314 | extern fn ___tracy_emit_memory_alloc_named(ptr: *const anyopaque, size: usize, secure: i32, name: [*:0]const u8) void; |
| 315 | extern fn ___tracy_emit_memory_alloc_callstack_named(ptr: *const anyopaque, size: usize, depth: c_int, secure: c_int, name: [*:0]const u8) void; | 315 | extern fn ___tracy_emit_memory_alloc_callstack_named(ptr: *const anyopaque, size: usize, depth: i32, secure: i32, name: [*:0]const u8) void; |
| 316 | extern fn ___tracy_emit_memory_free_named(ptr: *const anyopaque, secure: c_int, name: [*:0]const u8) void; | 316 | extern fn ___tracy_emit_memory_free_named(ptr: *const anyopaque, secure: i32, name: [*:0]const u8) void; |
| 317 | extern fn ___tracy_emit_memory_free_callstack_named(ptr: *const anyopaque, depth: c_int, secure: c_int, name: [*:0]const u8) void; | 317 | extern fn ___tracy_emit_memory_free_callstack_named(ptr: *const anyopaque, depth: i32, secure: i32, name: [*:0]const u8) void; |
| 318 | extern fn ___tracy_emit_message(txt: [*]const u8, size: usize, callstack: c_int) void; | 318 | extern fn ___tracy_emit_logString(severity: MessageSeverity, color: i32, callstack_depth: i32, size: usize, txt: [*]const u8) void; |
| 319 | extern fn ___tracy_emit_messageL(txt: [*:0]const u8, callstack: c_int) void; | 319 | extern fn ___tracy_emit_logStringL(severity: MessageSeverity, color: i32, callstack_depth: i32, txt: [*:0]const u8) void; |
| 320 | extern fn ___tracy_emit_messageC(txt: [*]const u8, size: usize, color: u32, callstack: c_int) void; | | |
| 321 | extern fn ___tracy_emit_messageLC(txt: [*:0]const u8, color: u32, callstack: c_int) void; | | |
| 322 | extern fn ___tracy_emit_frame_mark(name: ?[*:0]const u8) void; | 320 | extern fn ___tracy_emit_frame_mark(name: ?[*:0]const u8) void; |
| 323 | | 321 | |
| 324 | const ___tracy_source_location_data = extern struct { | 322 | const ___tracy_source_location_data = extern struct { |