Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(168)

Issue 1737263003: [coverage] Enable sanitizer coverage. (Closed)

Created:
4 years, 10 months ago by Michael Achenbach
Modified:
4 years, 9 months ago
CC:
v8-reviews_googlegroups.com
Base URL:
https://chromium.googlesource.com/v8/v8.git@master
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

[coverage] Enable sanitizer coverage. This adds sanitizer-coverage compilation, test-runner features and post processing. Sanitizer coverage is expected to be used together with asan. During test runner execution, the produced sancov files are disambiguated and match the pattern: <executable name>.test.<test id>.sancov. Two additional scripts are added for merging raw sancov files and for generating json data containing all instrumented lines + all covered lines from merged sancov files. Both scripts use multiprocessing for speed. The json data will later be uploaded to google storage for further use, e.g. to show coverage data in rietveld. Sancov documentation: http://clang.llvm.org/docs/SanitizerCoverage.html BUG=chromium:568949 LOG=n NOTRY=true TEST=python -m unittest sancov_formatter_test TEST=python -m unittest sancov_merger_test Committed: https://crrev.com/33ffced5ccd4b33f0c59e580e624cb28653a8c01 Cr-Commit-Position: refs/heads/master@{#34578}

Patch Set 1 #

Patch Set 2 : Clean ups #

Patch Set 3 : Exclude libcxx from instrumentation. #

Patch Set 4 : Clean up #

Patch Set 5 : Rebase #

Patch Set 6 : Formatter prototype #

Patch Set 7 : Clean up #

Patch Set 8 : More formatter functionality #

Patch Set 9 : Add tests and more refactoring. #

Patch Set 10 : More docu #

Patch Set 11 : Documentation #

Total comments: 20

Patch Set 12 : Review kjellander #

Total comments: 18

Patch Set 13 : Review Andrii #

Total comments: 8

Patch Set 14 : Review kjellander #

Patch Set 15 : Logging + exe blacklist #

Unified diffs Side-by-side diffs Delta from patch set Stats (+884 lines, -22 lines) Patch
M build/coverage_wrapper.py View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +10 lines, -2 lines 0 comments Download
M build/standalone.gypi View 4 chunks +6 lines, -5 lines 0 comments Download
M tools/run-deopt-fuzzer.py View 1 chunk +2 lines, -1 line 0 comments Download
M tools/run-tests.py View 3 chunks +12 lines, -1 line 0 comments Download
A tools/sanitizers/sancov_formatter.py View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +397 lines, -0 lines 0 comments Download
A tools/sanitizers/sancov_formatter_test.py View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +159 lines, -0 lines 0 comments Download
A tools/sanitizers/sancov_merger.py View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +167 lines, -0 lines 0 comments Download
A tools/sanitizers/sancov_merger_test.py View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +82 lines, -0 lines 0 comments Download
A tools/sanitizers/sanitize_pcs.py View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +11 lines, -0 lines 0 comments Download
M tools/testrunner/local/commands.py View 1 chunk +9 lines, -7 lines 0 comments Download
M tools/testrunner/local/execution.py View 1 2 3 4 2 chunks +21 lines, -0 lines 0 comments Download
M tools/testrunner/objects/context.py View 3 chunks +4 lines, -3 lines 0 comments Download
M tools/testrunner/objects/output.py View 2 chunks +4 lines, -3 lines 0 comments Download

Messages

Total messages: 34 (14 generated)
Michael Achenbach
PTA preliminary Look Not sure where to begin reviewing this. Maybe a high-level look at ...
4 years, 9 months ago (2016-03-03 16:38:38 UTC) #4
Michael Achenbach
Hold on, will give it another docu/refactoring round now.
4 years, 9 months ago (2016-03-04 09:03:31 UTC) #7
Michael Achenbach
PTAL now. Documented all methods in patch 11.
4 years, 9 months ago (2016-03-04 10:02:46 UTC) #8
kjellander_chromium
Sorry I didn't have time to finish the review now. I might be able to ...
4 years, 9 months ago (2016-03-04 14:35:22 UTC) #9
Michael Achenbach
First review done. https://codereview.chromium.org/1737263003/diff/200001/build/coverage_wrapper.py File build/coverage_wrapper.py (right): https://codereview.chromium.org/1737263003/diff/200001/build/coverage_wrapper.py#newcode21 build/coverage_wrapper.py:21: def remove_failsafe(l, item): On 2016/03/04 14:35:22, ...
4 years, 9 months ago (2016-03-04 15:00:26 UTC) #10
tandrii(chromium)
LGTM I think the pipeline is the sanest it could have been. https://codereview.chromium.org/1737263003/diff/200001/build/coverage_wrapper.py File build/coverage_wrapper.py ...
4 years, 9 months ago (2016-03-07 15:10:22 UTC) #11
Michael Achenbach
Done https://codereview.chromium.org/1737263003/diff/200001/build/coverage_wrapper.py File build/coverage_wrapper.py (right): https://codereview.chromium.org/1737263003/diff/200001/build/coverage_wrapper.py#newcode21 build/coverage_wrapper.py:21: def remove_failsafe(l, item): On 2016/03/07 15:10:22, tandrii(chromium) wrote: ...
4 years, 9 months ago (2016-03-07 16:07:21 UTC) #12
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1737263003/240001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1737263003/240001
4 years, 9 months ago (2016-03-07 16:07:35 UTC) #14
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 9 months ago (2016-03-07 16:26:18 UTC) #16
kjellander_chromium
lgtm, although I'd like to see my comments addressed/answered. https://codereview.chromium.org/1737263003/diff/240001/build/coverage_wrapper.py File build/coverage_wrapper.py (right): https://codereview.chromium.org/1737263003/diff/240001/build/coverage_wrapper.py#newcode22 build/coverage_wrapper.py:22: ...
4 years, 9 months ago (2016-03-08 04:48:33 UTC) #17
Michael Achenbach
All done. Thanks for the reviews! https://codereview.chromium.org/1737263003/diff/200001/tools/sanitizers/sancov_formatter.py File tools/sanitizers/sancov_formatter.py (right): https://codereview.chromium.org/1737263003/diff/200001/tools/sanitizers/sancov_formatter.py#newcode65 tools/sanitizers/sancov_formatter.py:65: OUTPUT_PATH_PREFIX = os.path.join(BUILD_DIR, ...
4 years, 9 months ago (2016-03-08 10:05:46 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1737263003/280001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1737263003/280001
4 years, 9 months ago (2016-03-08 10:39:31 UTC) #21
Michael Achenbach
Added a bit sanity logging in patch 15 to ease debugging later. Also blacklisted the ...
4 years, 9 months ago (2016-03-08 10:40:40 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1737263003/280001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1737263003/280001
4 years, 9 months ago (2016-03-08 10:42:51 UTC) #26
commit-bot: I haz the power
Committed patchset #15 (id:280001)
4 years, 9 months ago (2016-03-08 10:48:07 UTC) #28
commit-bot: I haz the power
Patchset 15 (id:??) landed as https://crrev.com/33ffced5ccd4b33f0c59e580e624cb28653a8c01 Cr-Commit-Position: refs/heads/master@{#34578}
4 years, 9 months ago (2016-03-08 10:48:48 UTC) #30
tandrii(chromium)
https://codereview.chromium.org/1737263003/diff/240001/build/coverage_wrapper.py File build/coverage_wrapper.py (right): https://codereview.chromium.org/1737263003/diff/240001/build/coverage_wrapper.py#newcode22 build/coverage_wrapper.py:22: try: On 2016/03/08 10:05:46, Michael Achenbach wrote: > On ...
4 years, 9 months ago (2016-03-08 14:48:57 UTC) #31
Michael Achenbach
https://codereview.chromium.org/1737263003/diff/240001/build/coverage_wrapper.py File build/coverage_wrapper.py (right): https://codereview.chromium.org/1737263003/diff/240001/build/coverage_wrapper.py#newcode22 build/coverage_wrapper.py:22: try: On 2016/03/08 14:48:57, tandrii(chromium) wrote: > On 2016/03/08 ...
4 years, 9 months ago (2016-03-08 14:54:00 UTC) #32
kjellander_chromium
On 2016/03/08 14:54:00, Michael Achenbach wrote: > https://codereview.chromium.org/1737263003/diff/240001/build/coverage_wrapper.py > File build/coverage_wrapper.py (right): > > https://codereview.chromium.org/1737263003/diff/240001/build/coverage_wrapper.py#newcode22 ...
4 years, 9 months ago (2016-03-08 15:08:48 UTC) #33
tandrii(chromium)
4 years, 9 months ago (2016-03-08 15:14:44 UTC) #34
Message was sent while issue was closed.
On 2016/03/08 15:08:48, kjellander (chromium) wrote:
> On 2016/03/08 14:54:00, Michael Achenbach wrote:
> >
>
https://codereview.chromium.org/1737263003/diff/240001/build/coverage_wrapper.py
> > File build/coverage_wrapper.py (right):
> > 
> >
>
https://codereview.chromium.org/1737263003/diff/240001/build/coverage_wrapper...
> > build/coverage_wrapper.py:22: try:
> > On 2016/03/08 14:48:57, tandrii(chromium) wrote:
> > > On 2016/03/08 10:05:46, Michael Achenbach wrote:
> > > > On 2016/03/08 04:48:33, kjellander (chromium) wrote:
> > > > > I guess it's faster to do
> > > > > if item in string_list:
> > > > >   string_list.remove(item)
> > > > > instead of allowing an exception to be thrown? Assuming exceptions are
> as
> > > > > expensive as in C++ and Java. Not a big deal here though, but if you
> want
> > :)
> > > > 
> > > > Done. Your way is definitely more readable and I don't care for speed
> here.
> > > This
> > > > is bounded by the number of objects, which are max 1000 for v8. And each
> > list
> > > > contains maybe ~30 items.
> > > 
> > > Your honor, I object! First, 
> > > try .. except ValueError: .. 
> > > is the Pythonic way to do stuff.
> > > Second, here each line takes O(n):
> > > 1) if x in list
> > > 2)   list.remove(x)
> > > 
> > > So, there is no way try..catch is slower than code above.
> > 
> > Right. Either way, I think it's hardly measurable given the small number of
> > objects. Maybe I change to more pythonic again in next CL.
> 
> I didn't know that, but then I also don't have Python readability :)
> Thanks for educating me.

Michael: nah, don't bother :)
Henrik: No readability either. But Python is so slow by itself that exceptions
don't really add much slowness (though as someone optimizing pure Python code
for quite a bit, I agree they are slower than if .. else statement).
Java/C++ are of course much much faster, and so I'd argue that on non hot-path
the cost of exceptions is neglible, and readability is the only concern.
Of course, at Google C++ exceptions are banned, though the main surviving reason
is "existing code isn't exception safe".

Powered by Google App Engine
This is Rietveld 408576698