perfetto: Make a MesaRenderpassDataSource with common setup/start/stop.
authorEmma Anholt <emma@anholt.net>
Thu, 16 Mar 2023 18:44:27 +0000 (11:44 -0700)
committerMarge Bot <emma+marge@anholt.net>
Thu, 30 Mar 2023 02:19:34 +0000 (02:19 +0000)
commit3fd825d3e2728954471012925555715739aa2e65
treedf67147aeacc45bd46220b2e581e05e804e764df
parent42f1df1ec5879edff5c633bbda3f12d677ae4a71
perfetto: Make a MesaRenderpassDataSource with common setup/start/stop.

Deduplicates some code from intel/tu/freedreno, and will be a common place
to put other shared code.

The downside I can see is this logging:

[013.129]      tu_perfetto.cc:122 Tracing started
[013.129]  intel_driver_ds.cc:133 Tracing started

("oh, huh, apparently data sources for both drivers are registered?  wild")

becomes:

[142.906] erfetto_renderpass.h:50 Tracing started
[142.907] erfetto_renderpass.h:50 Tracing started

("huh, why is my driver's data source being started twice?").
Unfortunately we can't easily get a string for the data source type due to
not having rtti.

Reviewed-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22157>
src/freedreno/vulkan/tu_perfetto.cc
src/gallium/drivers/freedreno/freedreno_perfetto.cc
src/intel/ds/intel_driver_ds.cc
src/util/perf/u_perfetto_renderpass.h [new file with mode: 0644]