xref: /aosp_15_r20/external/pigweed/third_party/perfetto/docs.rst (revision 61c4878ac05f98d0ceed94b57d316916de578985)
1.. _module-pw_third_party_perfetto:
2
3==========
4Perfetto
5==========
6The ``$dir_pw_third_party/perfetto/`` module provides the perfetto protos.  Only
7the protos are provided, and not the entire distribution, as there is no need
8for it.
9
10--------------------
11Code synchronization
12--------------------
13Unlike other third party libraries used by Pigweed, some perfetto source code is
14included in tree. A few factors drove this decision:
15
16- Core Pigweed tracing depend on these perfetto protos. Including the protos
17  in-tree avoids having Pigweed require an external repository.
18- The perfetto repository is too large to require downstream projects to clone.
19- It provides a consistent approach between between bazel and GN builds.
20- Perfetto is used as part of the default build.  ``pw package`` doesn't
21  currently have a good way to automatically install a required package.
22
23Files are synced from perfetto repository to the ``third_party/perfetto/repo``
24directory in Pigweed. The files maintain their original paths under that
25directory.
26
27Process
28=======
29Code is synchronized between the `perfetto repository
30<https://android.googlesource.com/platform/external/perfetto>`_ and the `Pigweed repository
31<https://pigweed.googlesource.com/pigweed/pigweed>`_ using the
32`third_party/perfetto/copy.bara.sky
33<https://cs.opensource.google/pigweed/pigweed/+/main:third_party/perfetto/copy.bara.sky>`_
34`Copybara <https://github.com/google/copybara>`_ script.
35
36To synchronize with the pigweed repository, run the ``copybara`` tool with the
37script:
38
39.. code-block:: bash
40
41   copybara third_party/perfetto/copy.bara.sky
42
43That creates a Gerrit change with updates from the perfetto repo, if any.
44
45If the ``copybara`` command fails, the Copybara script may need to be updated.
46Try the following:
47
48- Ensure that the source files in ``copy.bara.sky`` are up-to-date. Fix the list
49  if any files were renamed in Fuchsia.
50