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

registry_default_profiling.json

Contains default profiling registry data, such as profiling data produced by kzProfileScope calls.

registry_layoutoperation_profiling.json

Stores profiling data on the layout phase of the main loop.

registry_logging_profiling.json

Stores profiling data on log calls.

registry_mainloop_profiling.json

Stores overall main loop frame data.

registry_namedinterval_defaultregistry_profiling.json

Stores application level profiling data along with data produced by profiling scopes you add to the application.

registry_nodeoperation_profiling

Stores general profiling data on node operations, such as node instantiation and attaching.

registry_performanceinfo_profiling

Stores application performance metrics such as FPS, shader switches, and RAM and VRAM usage by application resources.

registry_profiling_metadata.json

Stores profiling metadata information that is used to convert the raw profiling data into visualizable data.

registry_renderoperation_profiling.json

Stores profiling data on the rendering phase of the main loop.

registry_startup_profiling.json

Stores startup performance data such as graphics stack initialization and kzb file opening time.

resource_profiling.json

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.