-
-
Notifications
You must be signed in to change notification settings - Fork 24
Profiling
Mosaic has been instrumented with the Tracy Profiler which can be enabled using the MOSAIC_ENABLE_PROFILING and TRACY_ENABLE compiler flags.
Tracy offers a frame-based inspection, which gives an insight into the inner mechanics of Mosaic's underlying engine and its plugins. This can be useful for understanding Mosaic, spotting orchestration anomalies or other bugs. It also visualises memory allocations over time which are useful for spotting memory leaks.
Tracy comes in two parts. The client, which is embedded into Mosaic (and optionally compiled), sends profiling information using a standard network protocol. The profiler then collects and visualises the client data; it can run locally or on a remote computer, on the same network. Both versions have to be identical, the profiler will warn you if you use incompatible client version.
You can debug Mosaic running on any computer (Mac/Windows/Linux) with another (Linux) computer running the Profiler on the same network. If using a remote computer, an RJ45 connection is recommended over wifi.
For more information on different ways to use Tracy, checkout its manual.
The Tracy profiler is hard to compile on OSX, because it needs a quite modern compiler. Therefore, it's recommended to compile it on Linux.
Checkout which Tracy version your Mosaic distribution is using in Mosaic/tracy/server/TracyVersion.hpp and download that same version of Tracy, which also contains the profiler.
Follow the profiler compilation procedure from the Tracy manual that you can find on the releases page.
Everything is almost ready, but you need to add a profiling build configuration to your build settings.
- Open Mosaic in Qt Creator, in the "Projects" section, select
Release, thenAdd > Clone Selectedand name it exactlyProfiling. - Change
ReleasetoProfilingin all fields below. (Build Directory,Configuration Name,Build Steps,Clean Steps) - You can now switch between 3 different build modes. Build the profiling one.
Start the profiler, enter Mosaic's local IP address and connect. As soon as you launch Mosaic, it should start profiling.
[Todo]