New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 801231 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jan 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 1
Type: Task



Sign in to add a comment

Test the performance of per directory code coverage generation on large unit test targets

Project Member Reported by liaoyuke@chromium.org, Jan 11 2018

Issue description

unit test targets like unit_tests and content_unittests may take long to run.
 

Comment 1 by mmoroz@chromium.org, Jan 11 2018

Yuke, could you please add some flag (e.g. -verbose or -debug) to the script, and when that flag is used, measure time spent on different actions we do in the script (i.e. build, run, merge, llvm-cov show, llvm-cov export).

Another option would be to always print timestamp whenever we do something in the script, e.g.:

10:23:55 Building the binaries...
10:37:12 Executing the commands...
10:45:42 Merging raw coverage dumps...
10:47:30 Generating HTML reports...
11:02:15 Calculating per-directory coverage data...

That would be enough. For per-directory generation step, we'll need to separate time spent on 'llvm-cov export' and on our python code in _GeneratePerDirectoryCoverageInHtml.
Sure, that sounds good!
I ran into issues running unit_tests target, so instead, I chose cc_blink_unittests target, and here is the result:

Building ['cc_blink_unittests']
ninja: Entering directory `out/coverage/'
[6/6] LINK ./cc_blink_unittests
[Debug] Build test targets took 57.145071 seconds
[Debug] Executing the commands
Running command: "out/coverage/cc_blink_unittests", the output is redirected to "out/exp_cc_blink_unittests/cc_blink_unittests_output.txt"
[Debug] Execute the commands took 17.912028 seconds

Creating the coverage profile data file
[Debug] Merging profraw files to create profdata file
[Debug] Merge profraw files took 32.864696 seconds
Code coverage profile data is created as: out/exp_cc_blink_unittests/coverage.profdata

Generating code coverage report in html (this can take a while depending on size of target!)
[Debug] Generating per file line by line coverage reports using "llvm-cov show" command
[Debug] "llvm-cov show" command took 2709.202398 seconds
[Debug] Generating per-file code coverage summary using "llvm-cov export -summary-only" command
[Debug] Generate per-file code coverage summary took 3932.268158 seconds
[Debug] Calculating and writing per-directory coverage reports
[Debug] Calculate and write per-directory coverage reports took 11.684772 seconds
Index file for html report is generated as: file:///usr/local/google/home/liaoyuke/chromium/src/out/exp_cc_blink_unittests/index.html

For a pretty big unit test target, the time spent on per-directory coverage calculation is only 11 seconds, so I'd conclude this part runs pretty fast, and it won't be a potential performance bottleneck.

Comment 4 by mmoroz@chromium.org, Jan 17 2018

That sounds reasonable, thanks Yuke! The "export" step will be much faster after next clang roll (that will include fix for  issue 801359 ), so the total time should be feasible.
Project Member

Comment 5 by bugdroid1@chromium.org, Jan 29 2018

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

commit 481d34803281fc68793b31eed9449c6444bba8ad
Author: Yuke Liao <liaoyuke@chromium.org>
Date: Mon Jan 29 19:17:10 2018

[Coverage] Add debug info for diagnostics.

This CL adds an argument option to print out debug info for diagnostics.

Bug:  801231 
Change-Id: I53b23c6569c9938ef4c5b5a786ceaeee751ffc5d
Reviewed-on: https://chromium-review.googlesource.com/871506
Reviewed-by: Abhishek Arya <inferno@chromium.org>
Commit-Queue: Yuke Liao <liaoyuke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#532530}
[modify] https://crrev.com/481d34803281fc68793b31eed9449c6444bba8ad/tools/code_coverage/coverage.py

Status: Fixed (was: Assigned)

Sign in to add a comment