This module requires (as of 2023-03-31 unreleased) beta 0.1.060 to work reliably due to bugs in older compiler versions related to message export/import.
Jai bindings for the Tracy profiler v0.9.
It’s originally based on vrcamillo/jai-tracy, but modified to work as an auto-instrumenting metaprogram plugin (like modules/Iprof).
- Ensure that the
tracy
submodule is cloned at the root of the repository. - Build the static and shared libraries using
jai build.jai
at the root of the repository.
Just use this module as a metaprogram plugin by adding -pluging tracy
to your compile command.
If you want to profile modules code (in addition to your application code) you can append the argument -modules
.
You might need to add -- import_dir <path_to_modules_folder_that_contains_tracy>
if this module does not live in your default modules folder.
You can even use this plugin to profile your compile-time metaprogram, #run commands, etc. But it requires some inception-style work:
- Tell the compile to use the Default_Metaprogram with the tracy plugin to compile … the Default_Metaprogram.
- Then use that second Default_Metaprogram to compile your project.
It looks something like this:
jai <path_to_jai>/modules/Default_Metaprogram.jai -plug tracy -modules -no_cwd \ # Compile Default_Metaprogram with the tracy plugin
- <your_normal_entry_file>.jai <your normal compile arguments> \ # Arguments for the second-stage Default_Metaprogram, which is what you would normally pass to the compiler/metaprogram
-- import_dir <path_to_modules_folder_that_contains_tracy> # Add this if you need to tell the first-stage Default_Metaprogram where to find the tracy module.
Tracy is released under the 3-clause BSD license.
These bindings are released under the MIT license.
You can find more detailed information in Tracy documentation, available in the official repository.