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