Tracy Profiler
A real time, nanosecond resolution, remote telemetry, hybrid frame and sampling profiler for games and other applications.
This is a bindings/wrapper library for the Odin programming language.
0. Prerequisites
This assumes you are using the latest nightly build or GitHub master of the Odin compiler. Since Odin is still under development this means these bindings might break in the future. Please create an issue or PR if that happens.
1. Cloning the sources
git clone https://github.com/oskarnp/odin-tracy
2. Building the Tracy profiler server
Tracy profiler server is built using CMake version 3.16 or later.
Example (using Clang compiler and Ninja build system):
CXX=clang++ CC=clang cmake -G Ninja -S vendor/tracy/profiler -B build/tracy-profiler -D CMAKE_BUILD_TYPE=Release
cmake --build build/tracy-profiler
Note
Add
-D LEGACY=ON
to first line to configure for X11 instead of Wayland if you are on Linux.
Refer to official manual for more details.
3. Building the Tracy profiler client library
Tracy profiler library is optionally built using CMake version 3.10 or later. See vendor/tracy/CMakeLists.txt for more information.
If you prefer to not use CMake you can build the client directly:
Mac OS
c++ -stdlib=libc++ -mmacosx-version-min=10.8 -std=c++11 -DTRACY_ENABLE -O2 -dynamiclib vendor/tracy/public/TracyClient.cpp -o tracy.dylib
Windows
cl -MT -O2 -DTRACY_ENABLE -c vendor\tracy\public\TracyClient.cpp -Fotracy
lib tracy.obj
Linux
c++ -std=c++11 -DTRACY_ENABLE -O2 vendor/tracy/public/TracyClient.cpp -shared -fPIC -o tracy.so
4. (Optional) Run the demo application / profiler client
odin run demo -define:TRACY_ENABLE=true
and then click Connect in Tracy profiler server.
Tip
Run the profiled application (e.g.
demo
) in privileged mode (sudo/administrator) to enable even more features in Tracy.
Important
For more details on how to use Tracy, please refer to the official manual.