Skip to content

Conversation

@BenjaminAmos
Copy link
Contributor

@BenjaminAmos BenjaminAmos commented Jun 23, 2024

Contains

This pull request integrates Terasology's PerformanceMonitor with the Tracy Profiler. This allows for better visualising performance traces and should help with diagnosing performance bottlenecks.

image

How to test

  • Clone a local copy of the Tracy bindings with https://github.com/MovingBlocks/TracyJavaBindings
  • Enable the Tracy profiler integration in Settings->Autoconfig
  • Start a new game
  • Open the debugging overlay with F3
  • Enable profiling by pressing F4 once

Outstanding before merging

  • Decide on a permanent home for the Tracy bindings library (should it stay under my namespace or be moved into the MovingBlocks organisation?)
  • Decide how to distribute the Tracy bindings library

@github-actions github-actions bot added the Type: Improvement Request for or addition/enhancement of a feature label Jun 23, 2024
@soloturn
Copy link
Contributor

@BenjaminAmos
Copy link
Contributor Author

https://github.com/BenjaminAmos/TracyJavaBindings should be public now. I was staging the library in a private repository and forgot to make it public before creating this pull request.

@jdrueckert
Copy link
Member

So, I just tested this out and noticed the following:
When hitting F4 in-game, the game crashed with an UnsatisfiedLinkError: Can't load library: /path/to/Terasology/natives/linux/tracy-jni.dll

What I did:

  1. groovyw lib get TracyJavaBindings
  2. in libs/TracyJavaBindings: chmod +x gradlew && git submodule update --init && ./gradlew jar
  3. Start Terasology and start a new game
  4. Press F4

Logs:

17:23:00.151 [main] ERROR o.t.engine.core.TerasologyEngine - Uncaught exception, attempting clean game shutdown
java.lang.UnsatisfiedLinkError: Can't load library: /home/jdr/Development/Git/Terasology-iota/natives/linux/tracy-jni.dll
	at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2398)
	at java.base/java.lang.Runtime.load0(Runtime.java:755)
	at java.base/java.lang.System.load(System.java:1953)
	at io.github.benjaminamos.tracy.Tracy.<clinit>(Tracy.java:17)
	at org.terasology.engine.monitoring.impl.PerformanceMonitorImpl.<init>(PerformanceMonitorImpl.java:83)

@BenjaminAmos
Copy link
Contributor Author

The library loading errors should be fixed by MovingBlocks/TracyJavaBindings@fa7be51.

@soloturn soloturn force-pushed the feat/tracy-profiler-integration branch from e4224e9 to a22a9cc Compare July 14, 2024 07:00
@soloturn
Copy link
Contributor

soloturn commented Oct 4, 2024

@BenjaminAmos can this one be merged or something is still open?

@BenjaminAmos
Copy link
Contributor Author

As far as I know, the only thing left before this can be merged is building the TracyJavaBindings library and publishing it to artifactory. We need builds for Windows, macOS and Linux, with macOS being the one that is usually the hardest to achieve.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: Improvement Request for or addition/enhancement of a feature

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

4 participants