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
- Addition of
u_trace_flush- because drivers need to have something to wait on in
u_trace_flushis the first place where drivers would reasonably be able to obtain a fence or other sync object.
- Passing of opaque
u_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 in
As for Turnip, I duplicated the tracepoints definitions and
- 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.
- 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_MEMCPYfallback - at submission time for every reusable command buffer
CP_MEMCPYis 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: