New issue
Advanced search Search tips

Issue 701059 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: May 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug

Blocked on:
issue 701085

Blocking:
issue 717014



Sign in to add a comment

Implement tracing support for webkit performance tests (blink_perf)

Project Member Reported by nedngu...@google.com, Mar 13 2017

Issue description

Blockedon: 701085
Status: Assigned (was: Untriaged)
Project Member

Comment 3 by bugdroid1@chromium.org, Apr 26 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/0d2d43615b4553f00ac711f54dbcc0835f04366b

commit 0d2d43615b4553f00ac711f54dbcc0835f04366b
Author: nednguyen <nednguyen@google.com>
Date: Wed Apr 26 20:45:11 2017

Support tracing metrics for measureTime & measureFrameTime methods in blink_perf

This CL adds support for tracing metrics with measureTime &
measureFrameTime methods in blink_perf harness.

If a test has "tracingCategories" & "traceEventsToMeasure" fields
specified, Telemetry will enable the specified tracing categories &
compute the cpu time of all the specified trace events (one per test
run).

Detailed examples of how to use this new API are in third_party/WebKit/PerformanceTests/TestData/

BUG= 701059 

Reviewer: you can see this in action by patching this CL & run:
./tools/perf/run_benchmark --browser=system blink_perf.testing --story-filter=frame --output-format=json
[ RUN      ] append-child-measure-time.html
...
...
CPU times of trace event "UpdateLayoutTree":
values 1.8760000000, 3.2080000000, 3.4260000000, 1.9020000000, 1.6990000000, 2.2940000000, 1.8570000000, 1.7100000000, 1.4170000000, 1.4150000000 ms
avg 2.0804000000 ms

CPU times of trace event "FrameView::layout":
values 4.6150000000, 8.3140000000, 8.6080000000, 4.4360000000, 4.0940000000, 5.9130000000, 4.5970000000, 3.9440000000, 3.4590000000, 3.4600000000 ms
avg 5.1440000000 ms
[ RUN      ] color-changes-measure-frame-time.html
...
...
CPU times of trace event "FrameView::prePaint":
values 5.9890000000, 5.9640000000, 6.2360000000, 6.3870000000, 5.9490000000, 6.3450000000, 6.3340000000, 6.9270000000, 6.8910000000 ms
avg 6.3357777778 ms

CPU times of trace event "FrameView::paintTree":
values 30.0950000000, 30.5020000000, 30.6510000000, 30.3380000000, 30.4160000000, 30.3480000000, 30.5110000000, 30.7570000000, 30.6140000000 ms
avg 30.4702222222 ms

After running the command above, the command also produces 2 trace files
locally, one for each test.

Review-Url: https://codereview.chromium.org/2819343002
Cr-Commit-Position: refs/heads/master@{#467445}

[add] https://crrev.com/0d2d43615b4553f00ac711f54dbcc0835f04366b/third_party/WebKit/PerformanceTests/TestData/append-child-measure-time.html
[add] https://crrev.com/0d2d43615b4553f00ac711f54dbcc0835f04366b/third_party/WebKit/PerformanceTests/TestData/color-changes-measure-frame-time.html
[modify] https://crrev.com/0d2d43615b4553f00ac711f54dbcc0835f04366b/third_party/WebKit/PerformanceTests/resources/runner.js
[modify] https://crrev.com/0d2d43615b4553f00ac711f54dbcc0835f04366b/tools/perf/benchmarks/blink_perf.js
[modify] https://crrev.com/0d2d43615b4553f00ac711f54dbcc0835f04366b/tools/perf/benchmarks/blink_perf.py
[add] https://crrev.com/0d2d43615b4553f00ac711f54dbcc0835f04366b/tools/perf/benchmarks/blink_perf_unittest.py

Project Member

Comment 4 by bugdroid1@chromium.org, Apr 26 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c4abf7fbfae66c20c30fdce1c95827e687cd4976

commit c4abf7fbfae66c20c30fdce1c95827e687cd4976
Author: alph <alph@chromium.org>
Date: Wed Apr 26 23:01:08 2017

Revert of Support tracing metrics for measureTime & measureFrameTime method in blink_perf (patchset #7 id:270001 of https://codereview.chromium.org/2819343002/ )

Reason for revert:
Seems to broke telemetry tests https://build.chromium.org/p/chromium.mac/builders/Mac10.9%20Tests%20%28dbg%29/builds/39895

Original issue's description:
> Support tracing metrics for measureTime & measureFrameTime methods in blink_perf
>
> This CL adds support for tracing metrics with measureTime &
> measureFrameTime methods in blink_perf harness.
>
> If a test has "tracingCategories" & "traceEventsToMeasure" fields
> specified, Telemetry will enable the specified tracing categories &
> compute the cpu time of all the specified trace events (one per test
> run).
>
> Detailed examples of how to use this new API are in third_party/WebKit/PerformanceTests/TestData/
>
>
> BUG= 701059 
>
>
> Reviewer: you can see this in action by patching this CL & run:
> ./tools/perf/run_benchmark --browser=system blink_perf.testing --story-filter=frame --output-format=json
> [ RUN      ] append-child-measure-time.html
> ...
> ...
> CPU times of trace event "UpdateLayoutTree":
> values 1.8760000000, 3.2080000000, 3.4260000000, 1.9020000000, 1.6990000000, 2.2940000000, 1.8570000000, 1.7100000000, 1.4170000000, 1.4150000000 ms
> avg 2.0804000000 ms
>
> CPU times of trace event "FrameView::layout":
> values 4.6150000000, 8.3140000000, 8.6080000000, 4.4360000000, 4.0940000000, 5.9130000000, 4.5970000000, 3.9440000000, 3.4590000000, 3.4600000000 ms
> avg 5.1440000000 ms
> [ RUN      ] color-changes-measure-frame-time.html
> ...
> ...
> CPU times of trace event "FrameView::prePaint":
> values 5.9890000000, 5.9640000000, 6.2360000000, 6.3870000000, 5.9490000000, 6.3450000000, 6.3340000000, 6.9270000000, 6.8910000000 ms
> avg 6.3357777778 ms
>
> CPU times of trace event "FrameView::paintTree":
> values 30.0950000000, 30.5020000000, 30.6510000000, 30.3380000000, 30.4160000000, 30.3480000000, 30.5110000000, 30.7570000000, 30.6140000000 ms
> avg 30.4702222222 ms
>
> After running the command above, the command also produces 2 trace files
> locally, one for each test.
>
> Review-Url: https://codereview.chromium.org/2819343002
> Cr-Commit-Position: refs/heads/master@{#467445}
> Committed: https://chromium.googlesource.com/chromium/src/+/0d2d43615b4553f00ac711f54dbcc0835f04366b

TBR=pdr@chromium.org,haraken@chromium.org,wangxianzhu@chromium.org,nednguyen@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG= 701059 

Review-Url: https://codereview.chromium.org/2844873002
Cr-Commit-Position: refs/heads/master@{#467498}

[delete] https://crrev.com/afc38d533169c0fb576d2def6f5a37943784100f/third_party/WebKit/PerformanceTests/TestData/append-child-measure-time.html
[delete] https://crrev.com/afc38d533169c0fb576d2def6f5a37943784100f/third_party/WebKit/PerformanceTests/TestData/color-changes-measure-frame-time.html
[modify] https://crrev.com/c4abf7fbfae66c20c30fdce1c95827e687cd4976/third_party/WebKit/PerformanceTests/resources/runner.js
[modify] https://crrev.com/c4abf7fbfae66c20c30fdce1c95827e687cd4976/tools/perf/benchmarks/blink_perf.js
[modify] https://crrev.com/c4abf7fbfae66c20c30fdce1c95827e687cd4976/tools/perf/benchmarks/blink_perf.py
[delete] https://crrev.com/afc38d533169c0fb576d2def6f5a37943784100f/tools/perf/benchmarks/blink_perf_unittest.py

Project Member

Comment 5 by bugdroid1@chromium.org, Apr 27 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c5cc2a4f4e1ae4dfd1459cba00e7d7a217bc1f70

commit c5cc2a4f4e1ae4dfd1459cba00e7d7a217bc1f70
Author: nednguyen <nednguyen@google.com>
Date: Thu Apr 27 11:25:47 2017

Support tracing metrics for measureTime & measureFrameTime methods in blink_perf (Reland)

* Fix include:
   1) handle cases thread_times = None
   2) disable testBlinkPerfTracingMetricsForMeasureTime on Win

This CL adds support for tracing metrics with measureTime &
measureFrameTime methods in blink_perf harness.

If a test has "tracingCategories" & "traceEventsToMeasure" fields
specified, Telemetry will enable the specified tracing categories &
compute the cpu time of all the specified trace events (one per test
run).

Detailed examples of how to use this new API are in third_party/WebKit/PerformanceTests/TestData/

BUG= 701059 ,  715822 

TBR=wangxianzhu@chromium.org

Reviewer: you can see this in action by patching this CL & run:
./tools/perf/run_benchmark --browser=system blink_perf.testing --story-filter=frame --output-format=json
[ RUN      ] append-child-measure-time.html
...
...
CPU times of trace event "UpdateLayoutTree":
values 1.8760000000, 3.2080000000, 3.4260000000, 1.9020000000, 1.6990000000, 2.2940000000, 1.8570000000, 1.7100000000, 1.4170000000, 1.4150000000 ms
avg 2.0804000000 ms

CPU times of trace event "FrameView::layout":
values 4.6150000000, 8.3140000000, 8.6080000000, 4.4360000000, 4.0940000000, 5.9130000000, 4.5970000000, 3.9440000000, 3.4590000000, 3.4600000000 ms
avg 5.1440000000 ms
[ RUN      ] color-changes-measure-frame-time.html
...
...
CPU times of trace event "FrameView::prePaint":
values 5.9890000000, 5.9640000000, 6.2360000000, 6.3870000000, 5.9490000000, 6.3450000000, 6.3340000000, 6.9270000000, 6.8910000000 ms
avg 6.3357777778 ms

CPU times of trace event "FrameView::paintTree":
values 30.0950000000, 30.5020000000, 30.6510000000, 30.3380000000, 30.4160000000, 30.3480000000, 30.5110000000, 30.7570000000, 30.6140000000 ms
avg 30.4702222222 ms

After running the command above, the command also produces 2 trace files
locally, one for each test.

Review-Url: https://codereview.chromium.org/2819343002
Cr-Commit-Position: refs/heads/master@{#467445}
Committed: https://chromium.googlesource.com/chromium/src/+/0d2d43615b4553f00ac711f54dbcc0835f04366b

patch from issue 2819343002 at patchset 270001 (http://crrev.com/2819343002#ps270001)

Review-Url: https://codereview.chromium.org/2844133002
Cr-Commit-Position: refs/heads/master@{#467637}

[add] https://crrev.com/c5cc2a4f4e1ae4dfd1459cba00e7d7a217bc1f70/third_party/WebKit/PerformanceTests/TestData/append-child-measure-time.html
[add] https://crrev.com/c5cc2a4f4e1ae4dfd1459cba00e7d7a217bc1f70/third_party/WebKit/PerformanceTests/TestData/color-changes-measure-frame-time.html
[modify] https://crrev.com/c5cc2a4f4e1ae4dfd1459cba00e7d7a217bc1f70/third_party/WebKit/PerformanceTests/resources/runner.js
[modify] https://crrev.com/c5cc2a4f4e1ae4dfd1459cba00e7d7a217bc1f70/tools/perf/benchmarks/blink_perf.js
[modify] https://crrev.com/c5cc2a4f4e1ae4dfd1459cba00e7d7a217bc1f70/tools/perf/benchmarks/blink_perf.py
[add] https://crrev.com/c5cc2a4f4e1ae4dfd1459cba00e7d7a217bc1f70/tools/perf/benchmarks/blink_perf_unittest.py

Blocking: 717014
Project Member

Comment 7 by bugdroid1@chromium.org, May 1 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/837b0ae2aa5d5755b995951575c3c57ee96f76fe

commit 837b0ae2aa5d5755b995951575c3c57ee96f76fe
Author: nednguyen <nednguyen@google.com>
Date: Mon May 01 16:59:10 2017

[blink_perf] Add log messages for tracing metrics in blink_perf

We add the following log messages:
* Error message when one of tracingCategories & traceEventsToMeasure is specified
but not the other.
* Hint users to use tools/perf/run_benchmark to get tracing based metrics

BUG= 701059 

Review-Url: https://codereview.chromium.org/2856463003
Cr-Commit-Position: refs/heads/master@{#468332}

[modify] https://crrev.com/837b0ae2aa5d5755b995951575c3c57ee96f76fe/third_party/WebKit/PerformanceTests/resources/runner.js

Project Member

Comment 8 by bugdroid1@chromium.org, May 3 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ed0baf9d5229f2869c8a909bc5761f21fd0a6eac

commit ed0baf9d5229f2869c8a909bc5761f21fd0a6eac
Author: nednguyen <nednguyen@google.com>
Date: Wed May 03 19:23:23 2017

Remove unused code in runner.js

BUG= 701059 

Review-Url: https://codereview.chromium.org/2860673004
Cr-Commit-Position: refs/heads/master@{#469069}

[modify] https://crrev.com/ed0baf9d5229f2869c8a909bc5761f21fd0a6eac/third_party/WebKit/PerformanceTests/resources/runner.js

Project Member

Comment 9 by bugdroid1@chromium.org, May 4 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/8dc2204a41db0b7b0f66c529c53d4c4a5d9d7fb5

commit 8dc2204a41db0b7b0f66c529c53d4c4a5d9d7fb5
Author: nednguyen <nednguyen@google.com>
Date: Thu May 04 01:27:34 2017

Refactor prepareToMeasureValuesAsync to startMeasureValuesAsyn which run test through callback

Motivation:
In order to support tracing metrics for prepareToMeasureValuesAsync method,
we need to be able to trigger tracing between prepareToMeasureValuesAsync &
actual test run. This CL rename prepareToMeasureValuesAsync method to
startMeasureValuesAsyn & refactor it  so that the
actual test code is specified as a callback, which allows the framework
to interject the startTrace() call before running test in the future.

BUG= 701059 

Review-Url: https://codereview.chromium.org/2858783003
Cr-Commit-Position: refs/heads/master@{#469233}

[modify] https://crrev.com/8dc2204a41db0b7b0f66c529c53d4c4a5d9d7fb5/third_party/WebKit/PerformanceTests/Bindings/post-message.html
[modify] https://crrev.com/8dc2204a41db0b7b0f66c529c53d4c4a5d9d7fb5/third_party/WebKit/PerformanceTests/Bindings/resources/structured-clone-perf-test.js
[modify] https://crrev.com/8dc2204a41db0b7b0f66c529c53d4c4a5d9d7fb5/third_party/WebKit/PerformanceTests/BlinkGC/resources/measure-gc.js
[modify] https://crrev.com/8dc2204a41db0b7b0f66c529c53d4c4a5d9d7fb5/third_party/WebKit/PerformanceTests/Canvas/resources/canvas_runner.js
[modify] https://crrev.com/8dc2204a41db0b7b0f66c529c53d4c4a5d9d7fb5/third_party/WebKit/PerformanceTests/Canvas/toBlob_duration.html
[modify] https://crrev.com/8dc2204a41db0b7b0f66c529c53d4c4a5d9d7fb5/third_party/WebKit/PerformanceTests/Canvas/toBlob_duration_jpeg.html
[modify] https://crrev.com/8dc2204a41db0b7b0f66c529c53d4c4a5d9d7fb5/third_party/WebKit/PerformanceTests/Dromaeo/resources/dromaeorunner.js
[modify] https://crrev.com/8dc2204a41db0b7b0f66c529c53d4c4a5d9d7fb5/third_party/WebKit/PerformanceTests/Parser/html-parser-threaded.html
[modify] https://crrev.com/8dc2204a41db0b7b0f66c529c53d4c4a5d9d7fb5/third_party/WebKit/PerformanceTests/resources/runner.js

Project Member

Comment 10 by bugdroid1@chromium.org, May 4 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/5f01ea694ea9f77fe1424d8fefac44a28e3d297e

commit 5f01ea694ea9f77fe1424d8fefac44a28e3d297e
Author: nednguyen <nednguyen@google.com>
Date: Thu May 04 14:44:50 2017

Move trace event emitting calls to outside of test run time measurement

This removes the overhead of emitting trace events from run time
measurement.
On tests like Layout/character_fallback_aat.html, this reduces the
test's duration 3x (0.015ms --> 0.005ms)

BUG= 716394 ,  701059 
TBR=wangxianzhu@chromium.org

Review-Url: https://codereview.chromium.org/2857403002
Cr-Commit-Position: refs/heads/master@{#469329}

[modify] https://crrev.com/5f01ea694ea9f77fe1424d8fefac44a28e3d297e/third_party/WebKit/PerformanceTests/resources/runner.js

Project Member

Comment 11 by bugdroid1@chromium.org, May 5 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/3262dfe6856cc6dc9a1e9260635b34572a0256e3

commit 3262dfe6856cc6dc9a1e9260635b34572a0256e3
Author: nednguyen <nednguyen@google.com>
Date: Fri May 05 17:43:24 2017

Support tracing metrics for measureValueAsync method

This exposes PerfTestRunner.addRunTestStartMarker &
PerfTestRunner.addRunTestEndMarker so that async perf tests can add their own
markers to get trace metrics. An example of how this works is shown in
third_party/WebKit/PerformanceTests/TestData/simple-blob-measure-async.html.

BUG= 701059 

Review-Url: https://codereview.chromium.org/2864643002
Cr-Commit-Position: refs/heads/master@{#469708}

[modify] https://crrev.com/3262dfe6856cc6dc9a1e9260635b34572a0256e3/third_party/WebKit/PerformanceTests/TestData/append-child-measure-time.html
[add] https://crrev.com/3262dfe6856cc6dc9a1e9260635b34572a0256e3/third_party/WebKit/PerformanceTests/TestData/simple-blob-measure-async.html
[modify] https://crrev.com/3262dfe6856cc6dc9a1e9260635b34572a0256e3/third_party/WebKit/PerformanceTests/resources/runner.js
[modify] https://crrev.com/3262dfe6856cc6dc9a1e9260635b34572a0256e3/tools/perf/benchmarks/blink_perf.py
[modify] https://crrev.com/3262dfe6856cc6dc9a1e9260635b34572a0256e3/tools/perf/benchmarks/blink_perf_unittest.py

I had testBlinkPerfTracingMetricsForMeasureTime fail on me on a Windows try run here: https://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_x64_rel_ng/builds/423144 Comment 5 sounds like that test is supposed to be disabled on Windows – is the test expected to run on the cq?
#12: the test is supposed to be run on Windows after the fix to handle thread time missing in the reland.
Status: Fixed (was: Assigned)
base blink_perf have 5 measurement methods:
measureTime
measurePageLoadTime
measureFrameTime
measureRunsPerSecond
measureValueAsync

We supported 4 of them (measureRunsPerSecond are left out as intended because this is meant to measure methods that run super fast, so use trace events for capturing these timing is not a good fit atm).
 
Examples of how to use tracing for the 4 methods are in https://cs.chromium.org/chromium/src/third_party/WebKit/PerformanceTests/TestData/ 

More documentation will be added later (tracked in  issue 715344 )

Sign in to add a comment