Skip to content

MovingBlocks/TracyJavaBindings

Repository files navigation

TracyJavaBindings – Java bindings for the Tracy Profiler

Prerequisites

  • After cloning the repository, ensure that you have checked-out submodules with git submodule update --init.

Building

JNI Bindings

  • You can build the JNI bindings with gradlew jar

Tracy profiler GUI

All commands need to be run in the tracy-jni/tracy subdirectory.

  • Create a new build folder under tracy-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-profiler executable can be found in the profiler/build/Release directory.

Integration

  • At runtime, the java.library.path system property should contain a path to the native JNI libraries found in tracy-jni/build/lib/main/release.

Usage Example

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()} }

About

Java Bindings for the Tracy Profiler

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published