doc: Add some very sparse perfetto documentation

Just tell people that timeline points are in perfetto, and how to
add a function trace.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
This commit is contained in:
Derek Foreman 2025-01-23 09:39:29 -06:00 committed by Daniel Stone
parent 0be4403f65
commit e22a11513d

View file

@ -178,6 +178,13 @@ The following illustrates how to use it:
./weston-debug timeline > log.json
./wesgr -i log.json -o log.svg
Weston has experimental support for `Perfetto <https://perfetto.dev>`_ for
performance profiling. It can be enabled by using `-Dperfetto=true` during
the meson invocation to configure the build.
If Perfetto support is built in, timeline points are added to Perfetto tracks
when Perfetto is running, even when the 'timeline' scope is not enabled.
Inserting timeline points
~~~~~~~~~~~~~~~~~~~~~~~~~
@ -186,6 +193,13 @@ take the :type:`weston_compositor` instance, followed by the name of the
timeline point. What follows next is a variable number of arguments, which
**must** end with the macro :c:macro:`TLP_END`.
Adding Perfetto trace points
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In addition to timeline points, Perfetto can also display timing information
for individual functions. The easiest way to add profiling data for a function
is to insert the :c:macro:`WESTON_TRACE_FUNC` at the top of the function.
Debug protocol API
------------------