- After cloning the repository, ensure that you have checked-out submodules with
git submodule update --init.
- You can build the JNI bindings with
gradlew jar
All commands need to be run in the
tracy-jni/tracysubdirectory.
- Create a new
buildfolder undertracy-jni/tracy/profiler. - Configure the profiler using
cmake -B profiler/build -S profiler -DCMAKE_BUILD_TYPE=Release(this only needs to be done once). - Build the profiler using
cmake --build profiler/build --parallel --config Release. - The built
tracy-profilerexecutable can be found in theprofiler/build/Releasedirectory.
- At runtime, the
java.library.pathsystem property should contain a path to the native JNI libraries found intracy-jni/build/lib/main/release.
importio.github.benjaminamos.tracy.Tracy; publicclassTracyTest{publicstaticvoidmain(String[] args){// Start profilingTracy.startupProfiler(); // Allocate and begin zonelonghandle = Tracy.allocSourceLocation(0, "Test.java", "test()", "Test!", 0); Tracy.ZoneContextzoneContext = Tracy.zoneBegin(handle, 1); // Do work...// End zoneTracy.zoneEnd(zoneContext); // Begin new frameTracy.markFrame(); // Stop profilingTracy.shutdownProfiler()} }