From 46a99987620abe2d0b16ad42ee4b2c238c0aa5fd Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Mon, 7 Nov 2022 07:33:36 -0800 Subject: [PATCH] tracy: support naming threads --- pkg/tracy/tracy.zig | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkg/tracy/tracy.zig b/pkg/tracy/tracy.zig index 11359af4d..a1d29b9c1 100644 --- a/pkg/tracy/tracy.zig +++ b/pkg/tracy/tracy.zig @@ -187,6 +187,11 @@ const Impl = struct { return .{}; } + /// Name the current thread. + pub inline fn setThreadName(comptime name: [:0]const u8) void { + c.___tracy_set_thread_name(name.ptr); + } + inline fn alloc(ptr: [*]u8, len: usize) void { if (has_callstack_support) { c.___tracy_emit_memory_alloc_callstack(ptr, len, callstack_depth, 0); @@ -245,6 +250,10 @@ const Noop = struct { pub inline fn frame(comptime name: [:0]const u8) Frame(name) { return .{}; } + + pub inline fn setThreadName(comptime name: [:0]const u8) void { + _ = name; + } }; test {}