mirror of
https://github.com/johan0A/zig-tracy.git
synced 2026-11-17 01:50:37 +00:00
No description
- Zig 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .github/workflows | ||
| example | ||
| src | ||
| vendor/tracy | ||
| .gitignore | ||
| build.zig | ||
| build.zig.zon | ||
| LICENSE | ||
| README.md | ||
zig-tracy
Library for instrumenting zig code for Tracy 0.13.1.
how to use
- Add
tracyto the dependency list inbuild.zig.zon:
zig fetch --save git+https://github.com/johan0A/zig-tracy
- Config
build.zig:
const tracy = b.dependency("tracy", .{
.enable_tracy = b.option(bool, "enable_tracy", "Enable Tracy profile markers") orelse false,
.enable_fibers = b.option(bool, "enable_fibers", "Enable Tracy fiber support") orelse false,
.on_demand = b.option(bool, "on_demand", "Build tracy with TRACY_ON_DEMAND") orelse false,
.default_callstack_depth = b.option(u32, "default_callstack_depth", "sets TRACY_CALLSTACK to the depth provided") orelse 0,
});
root_module.addImport("tracy", tracy.module("tracy"));
- Add markers to your code:
fn baz() void {
const zone = tracy.zone(@src());
defer zone.end();
foo();
bar();
}
see more in depth example in the example directory.