Additional profiling functionality¶
You can use the Kanzi Engine API to add extra profiling functionality to your applications.
Setting the output directory for profiling data¶
Use the ProfilingHelper::setOutputDirectory interface to set the directory where the profiling outputs will be generated. We recommend setting the output directory in either the Application::onConfigure or Application::onProjectLoaded function.
ProfilingHelper::setOutputDirectory("path/to/dir");
Using legacy profiling data output format¶
Profiling Helper Tool can create profiling outputs in a legacy format that is closer to how Kanzi stores profiling data internally. When using the legacy format, you need to convert the data to a format that is compatible with Perfetto UI and Google Chrome tracing view visualization tools.
Legacy profiling data output is enabled by defining USE_LEGACY_OUTPUT_FORMAT in profilinghelper_module.hpp file.
#define USE_LEGACY_OUTPUT_FORMAT
When the profiling is complete, Profiling Helper Tool produces these files:
File |
Description |
|---|---|
|
Contains default profiling registry data, such as profiling data produced by |
|
Stores profiling data on the layout phase of the main loop. |
|
Stores profiling data on log calls. |
|
Stores overall main loop frame data. |
|
Stores application level profiling data along with data produced by profiling scopes you add to the application. |
|
Stores general profiling data on node operations, such as node instantiation and attaching. |
|
Stores application performance metrics such as FPS, shader switches, and RAM and VRAM usage by application resources. |
|
Stores profiling metadata information that is used to convert the raw profiling data into visualizable data. |
|
Stores profiling data on the rendering phase of the main loop. |
|
Stores startup performance data such as graphics stack initialization and kzb file opening time. |
|
Stores resource profiling data such as how much time it takes to load and deploy each resource along with resource URLs. |
To convert the raw profiling data into visualizable format, you run the Application/bin/profiling2chrometrace.py script. The converted data is stored in chrome_tracing.json in the Application/bin directory.