Skip to content

panvk: add u_trace and perfetto support on v10

Chia-I Wu requested to merge olv/mesa:panvk-utrace into main

What does this MR do and why?

This MR lays the groundwork for u_trace support. I still need to clean it up and do more testing. Sending it out now only because I will be away for the rest of the week. It is ready for review now.

It adds support for GPU tracepoints and there is only CMDBUF tracepoint. When tracing is enabled,

  • vkBeginCommandBuffer and vkEndCommandBuffer emit cs_store_state to all subqueues to write gpu timestamps out
  • vkQueueSubmit executes the cmdbuf normally and asks u_trace to process the gpu timestamps in a background thread

The CMDBUF tracepoint is useful in seeing how much gpu time each subqueue spends for a cmdbuf submit.

MESA_GPU_TRACES=print is one way to enable tracing. The background thread will print the trace events together with gpu timestamps to stdout. Or, perfetto can enable tracing over a socket to collect the trace data.

I took a perfetto trace of vkcube-wayland. Here is a screeshot of the link

vkcube

vkcube-wayland-queue-%d shows the gpu trace events on the 3 subqueues on the gpu timeline. vkcube-wayland 1079 shows the cpu trace events of pid 1079 on the cpu timeline. The collected trace data include information to help perfetto align the cpu/gpu timelines.

It should be easy to add more GPU tracepoints (e.g., render pass, inter- and intra-subqueue wait, meta, etc.). It should also be easy to add CPU tracepoints (the screenshot shows cpu tracepoints from WSI). I plan to add them in future MRs and focus on the groundwork in this MR.

Edited by Chia-I Wu

Merge request reports

Loading