docs: put a list of commands to setup perfetto
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>
Wed, 27 Oct 2021 21:15:33 +0000 (00:15 +0300)
committerLionel Landwerlin <lionel.g.landwerlin@intel.com>
Thu, 28 Oct 2021 10:16:56 +0000 (13:16 +0300)
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Antonio Caggiano <antonio.caggiano@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13571>

docs/perfetto.rst

index 7fc20a6..dd78db5 100644 (file)
@@ -80,6 +80,30 @@ To capture a trace with perfetto you need to take the following steps:
 8. Alternatively you can open the trace in `AGI <https://gpuinspector.dev/>`__
    (which despite the name can be used to view non-android traces).
 
+To be a bit more explicit, here is a listing of commands reproducing
+the steps above :
+
+.. code-block:: console
+
+   # Configure Mesa with perfetto
+   mesa $ meson . build -Dperfetto=true -Dvulkan-drivers=intel,broadcom -Dgallium-drivers=
+   # Build mesa
+   mesa $ ninja -C build
+
+   # Within the Mesa repo, build perfetto
+   mesa $ cd subprojects/perfetto
+   perfetto $ ./tools/install-build-deps
+   perfetto $ ./tools/gn gen --args='is_debug=false' out/linux
+   perfetto $ ./tools/ninja -C out/linux
+
+   # Start perfetto
+   perfetto $ CONFIG=../../src/tool/pps/cfg/gpu.cfg OUT=out/linux/ ./tools/tmux -n
+
+   # In parallel from the Mesa repo, start the PPS producer
+   mesa $ ./build/src/tool/pps/pps-producer
+
+   # Back in the perfetto tmux, press enter to start the capture
+
 Driver Specifics
 ~~~~~~~~~~~~~~~~