blob: 7ddab17736cce6b35af2027d6c57df9594d90177 [file] [log] [blame]
u_trace GPU Performance Tracing
Mesa has its own GPU performance tracing framework which drivers may
choose to implement. ``gpu.renderstages.*`` producer for
:doc:`Perfetto Tracing <perfetto>` is based on u_trace.
It doesn't require external dependencies and much simpler to use. Though
it provides information only about GPU timings and is harder to analyze
for complex rendering.
u_trace is useful when one needs to quickly identify performance bottleneck,
or to build a tool to analyze the raw performance data.
Drivers which support u_trace:
- Intel drivers: ANV, Iris
- Adreno drivers: Freedreno, Turnip
u_trace is controlled by environment variables:
if set to ``1`` enables tracing and outputs the data into ``stdout``
specifies a file where to write the output instead of ``stdout``
controls a format of the output
human readable text format
json format, suitable for parsing. Application should appropriately
finish its rendering in order for trace's json to be valid.
For Vulkan API it is expected to destroy the device, for GL it is
expected to destroy the context.
Meaningful only for Perfetto tracing. If set to ``1`` enables
instrumentation of GPU commands before the tracing is enabled.
tracepoints can be enabled or disabled using driver specific environment
variable. Most tracepoints are enabled by default. For instance
``TU_GPU_TRACEPOINT=-blit,+render_pass`` will disable the
``blit`` tracepoints and enable the ``render_pass`` tracepoints.
.. list-table::
:header-rows: 1
* - Driver
- Environment Variable
- Tracepoint Definitions
* - Freedreno
- ``src/gallium/drivers/freedreno/``
* - Turnip
- ``src/freedreno/vulkan/``