From e22a11513d3743eafedae2bee06dbdd71a735564 Mon Sep 17 00:00:00 2001 From: Derek Foreman Date: Thu, 23 Jan 2025 09:39:29 -0600 Subject: [PATCH] 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 --- doc/sphinx/toc/libweston/log.rst | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/doc/sphinx/toc/libweston/log.rst b/doc/sphinx/toc/libweston/log.rst index 34e925431..63bf1c644 100644 --- a/doc/sphinx/toc/libweston/log.rst +++ b/doc/sphinx/toc/libweston/log.rst @@ -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 `_ 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 ------------------