Implement clang code coverage compiler wrapper |
||
Issue descriptionA compiler wrapper to enable instrumenting a subset of source files.
,
Oct 25
A wild idea that might be worth keeping in mind when working on things like this compiler wrapper. What if we create a thousand Chrome builds with different parts of it being instrumented and ship all those builds to our users. By collecting profdata from the users, we can see code coverage in-the-wild and detect a really dead code we're shipping :)
,
Oct 25
That is indeed a wild and great idea, though we need to be careful that coverage instrumentation won't cause any bugs or crashes, but it is definitely something worth keeping in mind for long term.
,
Oct 31
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/d7ce006f2538789b89d0e3efdd0fac630d069e8a commit d7ce006f2538789b89d0e3efdd0fac630d069e8a Author: Yuke Liao <liaoyuke@chromium.org> Date: Wed Oct 31 01:31:36 2018 Refactoring gcc_toolchain compiler wrappers This CL is pure non-op refactoring, it simplies the structure of existing compiler wrappers and makes it easier to add new wrappers. Specifically, this CL maintains the following behaviors: 1. When goma is off and static_analyzer is off: cxx command: clang++ <flags> asm command: clang <flags> 2. When goma is on and static_analyzer is off: cxx command: gomacc clang++ <flags> asm command: gomacc clang <flags> 3. When goma is off and static_analyzer is on: cxx command: analyzer_wrapper.py clang++ <flags> asm command: clang <flags> 4. When goma is on and static_analyzer is on: cxx command: analyzer_wrapper.py gomacc clang++ <flags> asm command: gomacc clang <flags> Basically, goma wapper applies to both cxx and asm while static_analyzer only applies to cxx. Bug: 898695 Change-Id: I12ed474d1286daa9fdc2f7ab5611745e99dd66a3 Reviewed-on: https://chromium-review.googlesource.com/c/1307847 Reviewed-by: Dirk Pranke <dpranke@chromium.org> Commit-Queue: Yuke Liao <liaoyuke@chromium.org> Cr-Commit-Position: refs/heads/master@{#604098} [modify] https://crrev.com/d7ce006f2538789b89d0e3efdd0fac630d069e8a/build/toolchain/gcc_toolchain.gni
,
Oct 31
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/bb571bd6cb0a1fbbf5132f114a46801854c6fdf7 commit bb571bd6cb0a1fbbf5132f114a46801854c6fdf7 Author: Yuke Liao <liaoyuke@chromium.org> Date: Wed Oct 31 21:51:52 2018 [Code Coverage] Implement Clang code coverage compiler wrapper This CL implements the Clang code coverage compiler wrapper, which can be used to instrument a subset of source files, and the main use case is to enable generating code coverage reports at per-cl level during try jobs. This CL only focuses on the wrapper itself, how to hook this wrapper into the build system will be addressed in a separate CL. Bug: 898695 Change-Id: Idb21640b5566ce78089059b3d0116390b488a383 Reviewed-on: https://chromium-review.googlesource.com/c/1301969 Commit-Queue: Yuke Liao <liaoyuke@chromium.org> Reviewed-by: Dirk Pranke <dpranke@chromium.org> Reviewed-by: Takuto Ikuta <tikuta@chromium.org> Cr-Commit-Position: refs/heads/master@{#604381} [add] https://crrev.com/bb571bd6cb0a1fbbf5132f114a46801854c6fdf7/build/toolchain/clang_code_coverage_wrapper.py [modify] https://crrev.com/bb571bd6cb0a1fbbf5132f114a46801854c6fdf7/docs/README.md [add] https://crrev.com/bb571bd6cb0a1fbbf5132f114a46801854c6fdf7/docs/clang_code_coverage_wrapper.md
,
Nov 2
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/9619c7100bab3b50c280efd021f92722bd1ab48e commit 9619c7100bab3b50c280efd021f92722bd1ab48e Author: Yuke Liao <liaoyuke@chromium.org> Date: Fri Nov 02 07:18:09 2018 [code coverage] Hook coverage wrapper to build toolchains 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-Commit-Position: refs/heads/master@{#604858} [modify] https://crrev.com/9619c7100bab3b50c280efd021f92722bd1ab48e/build/config/coverage/BUILD.gn [modify] https://crrev.com/9619c7100bab3b50c280efd021f92722bd1ab48e/build/config/coverage/coverage.gni [modify] https://crrev.com/9619c7100bab3b50c280efd021f92722bd1ab48e/build/toolchain/gcc_toolchain.gni [modify] https://crrev.com/9619c7100bab3b50c280efd021f92722bd1ab48e/build/toolchain/mac/BUILD.gn [modify] https://crrev.com/9619c7100bab3b50c280efd021f92722bd1ab48e/build/toolchain/nacl_toolchain.gni [modify] https://crrev.com/9619c7100bab3b50c280efd021f92722bd1ab48e/docs/clang_code_coverage_wrapper.md
,
Nov 12
|
||
►
Sign in to add a comment |
||
Comment 1 by liaoyuke@chromium.org
, Oct 24Labels: per_cl