Branching Perfetto for Chrome milestones
Merging a (set of) Perfetto change(s) to a Chrome milestone release requires
creation of a branch in the perfetto repo, cherry-picking of the change(s) to
the branch, and updating the DEPS
file in Chrome's milestone branch to point
to the new perfetto branch's head.
Creating the perfetto branch
Determine the branch name:
chromium/XXXX
, whereXXXX
is the branch number of the milestone (see Chromium Dash). Example for M87:chromium/4280
.Check if the branch already exists: if yes, skip to cherry-picking. To check, you can search for it in Gerrit's branch page.
Look up the appropriate base revision for the branch. You should use the revision that Chromium's
DEPS
of the milestone branch points to (search forperfetto
in the file). TheDEPS
file for branch XXXX is at:https://chromium.googlesource.com/chromium/src.git/+/refs/branch-heads/XXXX/DEPS
Example for M87:
DEPS
(at time of writing) points tof4cf78e052c9427d8b6c49faf39ddf2a2e236069
.Create the branch - the easiest way to do this is via Gerrit's branch page. The
NEW BRANCH
button on the top right opens a wizard - fill in the branch name and base revision determined above. If this fails with a permission issue, contact the Discord chat or perfetto-dev mailing list.
Cherry-picking the change(s)
If there are no merge conflicts, cherry-picking via Gerrit will be easiest. To attempt this, open your change in Gerrit and use the
Cherry pick
entry in the overflow menu on the top right, providing thechromium/XXXX
branch name (see above).Otherwise, merge the patch locally into a branch tracking
origin/chromium/XXXX
and upload a Gerrit change as usual:git fetch origin git checkout -tb cpick origin/chromium/XXXX git cherry-pick -x <commit hash> # Resolve conflicts manually. tools/gen_all out/xxx # If necessary. git cl upload # Remove "Change-Id:" lines from commit message.
Send the patch for review and land it. Note the commit's revision hash.
Updating the DEPS file in Chromium
Create, send for review, and land a Chromium patch that edits the top-level
DEPS
file on the Chromium's milestone branch. You can also combine this step with cherry-picks of any chromium changes. For details, see Chromium's docs. It amounts to:$ gclient sync --with_branch_heads $ git fetch $ git checkout -tb perfetto_uprev refs/remotes/branch-heads/XXXX $ ... # Edit DEPS. $ git cl upload