radv: allow to capture SQTT traces with RADV_THREAD_TRACE=<start_frame>
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 20 Feb 2020 12:22:31 +0000 (13:22 +0100)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 28 Feb 2020 07:11:11 +0000 (08:11 +0100)
commitbf16ff317256c208e21362191bb93200925ea944
tree69f0eb4153dc3f93c0d4882ac9793936577438de
parented0c852243719c6bac420de50a2f1061250e5b51
radv: allow to capture SQTT traces with RADV_THREAD_TRACE=<start_frame>

This is pretty basic (and a bit crappy at the moment). I think we
might want some sort of overlay in the future and also be able to
trigger captures with F12 or whatever.

To record a capture, set RADV_THREAD_TRACE to something greater than
zero (eg. RADV_THREAD_TRACE=100 will capture frame #100). If the
driver didn't crash (or the GPU didn't hang), the capture file
should be stored in /tmp.

To open that capture, use Radeon GPU Profiler and enjoy your
profiling times with RADV! \o/

Note that thread trace support is quite experimental, only GFX9 is
supported at the moment, and a bunch of useful stuff are still missing
(shader ISA, pipelines info, etc). More is comming soon.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3900>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3900>
src/amd/vulkan/radv_device.c
src/amd/vulkan/radv_private.h
src/amd/vulkan/radv_wsi.c