Skip to content
This repository has been archived by the owner on Jul 27, 2022. It is now read-only.

Contributing

Nat Duca edited this page May 21, 2015 · 12 revisions

Contributing to trace-viewer

Please note: We use Rietveld to review patches to trace-viewer. We tried using Pull Requests but found the functionality provided by Rietveld to better suit our needs.

You will need depot_tools in order to contribute to trace-viewer.

Contributing.

Start by checking out the trace-viewer repo.

git clone https://github.com/google/trace-viewer

You can then create a local branch, make and commit your changes.

cd trace-viewer
git checkout -t -b foo origin/master
... edit files ...
git commit -a -m "New Files"

Once you're ready for a review do:

git cl upload

Once uploaded you can view the CL in Rietveld and request a review by clicking on the 'publish & mail' link.

If you get review feedback, edit and commit locally and then do another upload with the new files. Before you commit you'll want to sync to the tip-of-tree. You can either merge or rebase, it's up to you.

Then, submit your changes.

git cl land

Once everything is landed, you can cleanup your branch.

git checkout master
git branch -D foo

Contributing from a Chromium checkout

If you already have Trace Viewer checked out as part of a Chromium checkout and want to edit it in place (instead of having a separate clone of the repository), you will probably want to disconnect it from gclient at this point so that it doesn't do strange things on updating. This is done by editing the .gclient file for your Chromium checkout and adding the following lines:

'custom_deps': {
     'src/third_party/trace-viewer': None,
},

In order to be able to land patches, you will most likely need to update the origin remote in your Trace Viewer checkout to point directly to this GitHub repository. You can do this by executing the following command inside the Trace Viewer folder (third_party/trace-viewer):

git remote set-url origin [email protected]:google/trace-viewer

Development

When working on trace-viewer you'll be using the dev server a lot. This is used to both run the tests and to view the example trace files. You can run the dev server by doing:

./run_dev_server.py

You can now run a tracing example page by going to http://localhost:8003/examples/trace_viewer.html ... this will show any file in the ./test_data/.

Trace viewer is heavily unit tested. You can run any of the tests by browsing to http://localhost:8003/.

Legal

If you're new to the chromium-family of projects, you will also need to sign the chrome contributors license agreement. You can sign the Contributor License Agreement, which you can do online. It only takes a minute. If you are contributing on behalf of a corporation, you must fill out the Corporate Contributor License Agreement and send it to us as described on that page.

If you've never submitted code before, you must add your (or your organization's) name and contact info to the Chromium AUTHORS file.

Working with examples page

The examples/trace_viewer.html is a standalone Web page simulating the about:tracing page with canned tracing data.

If you run the run_dev_server.py script in the root directory then navigate to localhost:8003/examples/trace_viewer.html you should be able to see an example trace.

If you want to see other data, place your file in the test_data directory and reload the trace_viewer.html page. It isn't possible to capture a new trace from the example file as chrome://tracing has to be built directly into chrome to have the needed access.

Updating Chromium's about:tracing

To get your change to appear in Chrome's about:tracing, commit to trace-viewer. Make a note of the svn revision you landed. Then find the git revision by rebasing third_party/trace-viewer to origin/master and finding the corresponding git rev for your patch:

$ cd $CHROMIUM_SRC/third_party/trace-viewer
$ git fetch && git rebase origin/master
$ git log
...
commit 6f49169ab7d1d58a6c10e6631ebe91f191b4892b
Author: [email protected]
Date:   Wed Aug 20 00:00:00 2014 +0000

    Patch description

Then edit Chrome's src/DEPS file. Look in there for a line like:

  "src/third_party/trace-viewer":                                                |
      Var("chromium_git") + "/external/trace-viewer.git@6f49169ab7d1d58a6c10e6631e\|
be91f191b4892b", # from svn revision 1489

Update the number to the git/svn rev you want to roll to, and contribute a codereview to chrome for the edit. If you are a Chromium committer, feel free to TBR this.

Some notes

  • Testing full files against importer changes: put a file into test_data/, then edit and run src/interactive_tests.html.
Clone this wiki locally