This moved u_trace from gallium to the common utils and with a little modification it could be usable for Vulkan drivers.
The notable changes to u_trace
are:
- Addition of
fence
parameter tou_trace_flush
- because drivers need to have something to wait on inu_trace_read_ts
callback andu_trace_flush
is the first place where drivers would reasonably be able to obtain a fence or other sync object. - Passing of opaque
flush_data
pointer viau_trace_flush
. There is data which becomes available only at this point which other drivers may want to pass. For example Vulkan drivers would want to pass at least submission id (for perfetto) and a sync object to wait on inu_trace_read_ts
.
As for Turnip, I duplicated the tracepoints definitions and RenderpassDataSource
implementation.
- Not everything useful is timestamped at the moment and probably not all useful info is added to tracepoints
-
There is no per-draw tracing, only per tile.Tracing every drawcall incurred too big overhead. As a middle ground only gmem load/store/clears are traces per tile.
Changelog:
- Payload's serialization is now auto-generated
- Reduced the
tu_start_/tu_end_
callback duplication via macro - Re-usable command buffers are supported via
CP_MEMCPY
fallback - at submission time for every reusable command bufferCP_MEMCPY
is added to copy all timestamps - GMEM load/stores/clears are traced per tile, also sysmem clears traced
: Better support of re-usage and simultaneous command buffer would require being able to write gpu time (with CP_EVENT_WRITE_0_TIMESTAMP
) at indirect offset, which would require fw patching (see #4789), or we would have to copy the timestamp buffer after the each commandstream.
On the other hand I don't know any real games using other than VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT
command buffers and DXVK/VKD3D don't use other types either. However, vkcube and Vulkan samples do use reusable command buffers...
- 9fbd3088351b92e8c2cef6e37a39decb12a8d5bb "drm/msm: Fix a5xx/a6xx timestamps"
- 3ab1c5cc3939b3322ebd27a44b8ee6a16eccc9f5 "drm/msm: Add param for userspace to query suspend count"
Example of VkQuake trace: