Right now Java per-CL coverage instrument everything as full code base coverage.
To only instrument class files related to affected files in a CL, we can:
1. Extract class files only related to affected source files in a jar.
2. Instrument these extracted class files.
3. Extract unaffected members from original jar.
4. Zip everything out to output path.
Bug: 1001387
Change-Id: Iaf6a75c7f8005b5d64eee22bc604f25d0c2fcd8c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1797109
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Reviewed-by: Yuke Liao <liaoyuke@chromium.org>
Reviewed-by: Andrew Grieve <agrieve@chromium.org>
Commit-Queue: Yun Liu <yliuyliu@google.com>
Cr-Original-Commit-Position: refs/heads/master@{#697661}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: c0f2f73bc76d220a37f98c6eb14f849980821842
This CL removes the dependency between use_clang_coverage and
coverage_instrumentation_input_file so that the coverage feature can
be turned off with a single change by setting use_clang_coverage to
false.
Change-Id: Iff4d4c3207fa82d81a5b6bcfe417cc955764096d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1698670
Reviewed-by: Max Moroz <mmoroz@chromium.org>
Commit-Queue: Yuke Liao <liaoyuke@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#676959}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 9eb53f51810a4b835020760d31e5f31601d1889e
After clang r360674, each .obj file embeds the path to the profile library
as a dependent lib. No intended behavior change.
Change-Id: Ie892fccdb8aaefc2545db56fb3274dc6f0992a96
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1630986
Reviewed-by: Hans Wennborg <hans@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#663751}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 5158b6cfadd24bce1f1bf6738a5f369313adf176
This is a fix for crrev.com/c/1496002, which was reverted because of a
1-character mistake. The rest of the CL message is copied from the
original:
Previously the wrapper script would only be used for coverage builds
that required selective instrumentation of specific files. Now it
will also be used for any coverage builds.
Since the script's job is to remove flags from files that shouldn't
have them the default_coverage config now adds to cflags even in a
CQ build.
Bug: 918215
Change-Id: Ifdb13657c0c7a80d79960b411050e4f8918fa172
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1508560
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Sajjad Mirza <sajjadm@google.com>
Cr-Original-Commit-Position: refs/heads/master@{#638762}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 494df319742a206bca4d28ac6e0707bdd7d9a3ee
This reverts commit 78d6b9950b4bd9462c226b2cc2ac1f74ad84ad6a.
Reason for revert:
This broke the coverage builds, see e.g.
https://ci.chromium.org/p/chromium/builders/ci/ToTLinuxCoverage/6258
which fails with:
"/bin/sh: 1: ../../build/toolchain/clang_code_coverage_wrapper.py--target-os=linux: not found"
I guess there's a missing space before --target-os.
Could this have been found in testing?
Original change's description:
> Use the wrapper script in all coverage builds.
>
> Previously the wrapper script would only be used for coverage builds
> that required selective instrumentation of specific files. Now it
> will also be used for any coverage builds.
>
> Since the script's job is to remove flags from files that shouldn't
> have them the default_coverage config now adds to cflags even in a
> CQ build.
>
> Bug: 918215
> Change-Id: I012c5732d46bf5cff9eaf8f50615739bb781cc29
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1496002
> Commit-Queue: Sajjad Mirza <sajjadm@google.com>
> Reviewed-by: Dirk Pranke <dpranke@chromium.org>
> Reviewed-by: Max Moroz <mmoroz@chromium.org>
> Reviewed-by: Yuke Liao <liaoyuke@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#638321}
TBR=stgao@chromium.org,dpranke@chromium.org,robertocn@chromium.org,mmoroz@chromium.org,liaoyuke@chromium.org,sajjadm@google.com
Change-Id: I8a945239dadc84d5e1c55a94ee84e34f413e54d5
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 918215
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1508457
Reviewed-by: Hans Wennborg <hans@chromium.org>
Commit-Queue: Hans Wennborg <hans@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#638561}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: a3a48425d72da578ca09184e89ef898b405550c5
Previously the wrapper script would only be used for coverage builds
that required selective instrumentation of specific files. Now it
will also be used for any coverage builds.
Since the script's job is to remove flags from files that shouldn't
have them the default_coverage config now adds to cflags even in a
CQ build.
Bug: 918215
Change-Id: I012c5732d46bf5cff9eaf8f50615739bb781cc29
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1496002
Commit-Queue: Sajjad Mirza <sajjadm@google.com>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Reviewed-by: Max Moroz <mmoroz@chromium.org>
Reviewed-by: Yuke Liao <liaoyuke@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#638321}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 78d6b9950b4bd9462c226b2cc2ac1f74ad84ad6a
This CL hooks the Clang code coverage wrapper into the build
toolchains, and specifically, a new build flag:
coverage_instrumentation_input_file is added to allow turning on/off
the wrapper and pass the list-files-to-instrument around.
Bug: 898695
Change-Id: I405ccbfc1796afa44534794d711f2953fac78f6d
Reviewed-on: https://chromium-review.googlesource.com/c/1309999
Commit-Queue: Yuke Liao <liaoyuke@chromium.org>
Reviewed-by: Takuto Ikuta <tikuta@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#604858}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 9619c7100bab3b50c280efd021f92722bd1ab48e
On Windows, the linker is invoked directly, so we can't add
-finstr-profile-generate to ldflags and expect things to work. Instead,
explicitly link against the appropriate library.
Update clang's package.py script to include clang_rt.profile-*.lib.
After this, base_unittests links, but crashes during shutdown when
writing the profile.
BUG=846918
R=thakis@chromium.org,mmoroz@chromium.org
Change-Id: I337e587b83750c86546a9673daeb593d4125bbd9
Reviewed-on: https://chromium-review.googlesource.com/1153625
Commit-Queue: Reid Kleckner <rnk@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Reviewed-by: Max Moroz <mmoroz@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#579161}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 0cbb2ddc9cec38649e71ba2c3bfb0ba3b240e76c
On Windows, clang always uses regular atexit, so this wouldn't do
anything even if clang-cl did understand the flag.
R=mmoroz@chromium.org
BUG=846918
Change-Id: I59523e818488b5de3331a7851ae51a381a3e5c17
Reviewed-on: https://chromium-review.googlesource.com/1081202
Reviewed-by: Max Moroz <mmoroz@chromium.org>
Commit-Queue: Reid Kleckner <rnk@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#563460}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 9aa0375e58d62b3134cc38363e0b54b8bf2208af
This CL sets -limited-coverage-experimental=true to allow building
large unit test target on Mac.
Bug: 796290
Change-Id: Ief6277ae2ea3d4e1372c4fd796e97c2a1ae0bfba
Reviewed-on: https://chromium-review.googlesource.com/891799
Commit-Queue: Yuke Liao <liaoyuke@chromium.org>
Reviewed-by: Abhishek Arya <inferno@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#532700}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: e9592c502eefc7101342bf97f0606f94e1ae612e
I've been testing the changes on net_parse_cookie_line_fuzzer,
which is a fuzz target of average size written in C++.
Improvements step by step:
0) Original configuration, Coverage + ASan:
158 MB 1,000 exec/s
1) Prohibit ASan (and other sanitizers), use only Coverage instrumentation:
132 MB same speed
The following change hasn't been applied, but let's keep it in the description FTR:
- 2) Disable sanitizer coverage (which is different from clang source-based coverage):
- 90 MB 1,088 exec/s (speed +8-10%)
3) Avoid optimize_for_fuzzing config (i.e. use -O3 instead of -O1 for coverage build):
Same size 1,773 exec/s (speed +60-65% on top of the previous change)
4) Disable coverage for libFuzzer source code:
88 MB 3,988 exec/s (speed +125% on top of previous changes)
5) Disable coverage for libc++ and libc++abi sources
(https://chromium-review.googlesource.com/#/c/chromium/buildtools/+/693570):
86 MB 4,110 exec/s (speed +3% on top of previous changes)
In total, for that particular target:
- build size reduced by ~45%
- execution speed increased by ~310%
I've also tested the changes with zlib_uncompress_fuzzer (a tiny fuzz target for C-library):
- build size reduced by ~83%
- execution speed increased by ~120%
I haven't measured impact on the other fuzz targets, so it may vary a lot,
but the result seems to be quite significant anyway.
Bug: 759794
Change-Id: Icf61c979e38d0f7849ab7281bd9e24cf2b7a7d02
Reviewed-on: https://chromium-review.googlesource.com/693564
Reviewed-by: Brett Wilson <brettw@chromium.org>
Reviewed-by: Oliver Chang <ochang@chromium.org>
Commit-Queue: Abhishek Arya <inferno@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#506454}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: c8fee977deb6f47aaf602813b00428adfe7baa74