Optionally enable LLVM profile continuous mode#15166
Optionally enable LLVM profile continuous mode#15166fmeum wants to merge 1 commit intobazelbuild:masterfrom
Conversation
LLVM's profile instrumentation offers a continuous mode in which counters are continuously synced to a file rather than being dumped once in an exit hook. This is useful for coverage runs that include binaries that exit abnormally (e.g. in failure tests), but may require additional compiler flags and can negatively impact runtime performance and memory usage. Enabling continuous mode requires adding the "%c" modifier to the value of the LLVM_PROFILE_FILE environment variable. With this commit, the collect_coverage.sh script adds the modifier if the test environment has the variable LLVM_PROFILE_CONTINUOUS_MODE set. This allows both all and individual tests to use continuous mode by setting the variable, either via --test_env or the env attribute.
|
@c-mita This is a minimal change required to make LLVM profile's continuous mode usable with Bazel at all (everything else can be configured via existing knobs). Since I need this mode to properly generate complete coverage reports for Jazzer, I am very interested in getting at least this change into Bazel. If you would appreciate a better integration, I could submit a follow-up PR that adds the required compiler flags as toolchain features together with an experimental flag, similar to the existing |
|
@c-mita Sorry for the high PR load, but I assume this one is also yours to review |
Coverage reports can be generated via: bazel run //bazel/coverage Due to bazelbuild/bazel#15166, coverage collection does not yet encompass tests that end with a native sanitizer report.
Coverage reports can be generated via: bazel run //bazel/coverage Due to bazelbuild/bazel#15166, coverage collection does not yet encompass tests that end with a native sanitizer report. Temporarily updates .bazelversion to an unreleased version of Bazel that includes required coverage fixes.
Coverage reports can be generated via: bazel run //bazel/coverage Due to bazelbuild/bazel#15166, coverage collection does not yet encompass tests that end with a native sanitizer report. Temporarily updates .bazelversion to an unreleased version of Bazel that includes required coverage fixes.
|
@c-mita Friendly ping |
Coverage reports can be generated via: bazel run //bazel/coverage Due to bazelbuild/bazel#15166, coverage collection does not yet encompass tests that end with a native sanitizer report. Temporarily updates .bazelversion to an unreleased version of Bazel that includes required coverage fixes.
Coverage reports can be generated via: bazel run //bazel/coverage Due to bazelbuild/bazel#15166, coverage collection does not yet encompass tests that end with a native sanitizer report. Temporarily updates .bazelversion to an unreleased version of Bazel that includes required coverage fixes.
Coverage reports can be generated via: bazel run //bazel/coverage Due to bazelbuild/bazel#15166, coverage collection does not yet encompass tests that end with a native sanitizer report. Temporarily updates .bazelversion to an unreleased version of Bazel that includes required coverage fixes.
Coverage reports can be generated via: bazel run //bazel/coverage Due to bazelbuild/bazel#15166, coverage collection does not yet encompass tests that end with a native sanitizer report. Temporarily updates .bazelversion to an unreleased version of Bazel that includes required coverage fixes.
Coverage reports can be generated via: bazel run //bazel/coverage Due to bazelbuild/bazel#15166, coverage collection does not yet encompass tests that end with a native sanitizer report. Temporarily updates .bazelversion to an unreleased version of Bazel that includes required coverage fixes.
|
@c-mita Friendly ping, could you take a look? |
c-mita
left a comment
There was a problem hiding this comment.
I think it's fine. @oquenchil - would it be worth getting this integrated with a flag?
|
@bazel-io flag |
|
@bazel-io fork 5.3.0 |
LLVM's profile instrumentation offers a continuous mode in which counters are continuously synced to a file rather than being dumped once in an exit hook. This is useful for coverage runs that include binaries that exit abnormally (e.g. in failure tests), but may require additional compiler flags and can negatively impact runtime performance and memory usage. Enabling continuous mode requires adding the "%c" modifier to the value of the LLVM_PROFILE_FILE environment variable. With this commit, the collect_coverage.sh script adds the modifier if the test environment has the variable LLVM_PROFILE_CONTINUOUS_MODE set. This allows both all and individual tests to use continuous mode by setting the variable, either via --test_env or the env attribute. Closes #15166. PiperOrigin-RevId: 454558752 Change-Id: Id03d00d0644742e336feab41ea479d7d8527f6c4 Co-authored-by: Fabian Meumertzheim <[email protected]>
LLVM's profile instrumentation offers a continuous mode in which counters are continuously synced to a file rather than being dumped once in an exit hook. This is useful for coverage runs that include binaries that exit abnormally (e.g. in failure tests), but may require additional compiler flags and can negatively impact runtime performance and memory usage. Enabling continuous mode requires adding the "%c" modifier to the value of the LLVM_PROFILE_FILE environment variable. With this commit, the collect_coverage.sh script adds the modifier if the test environment has the variable LLVM_PROFILE_CONTINUOUS_MODE set. This allows both all and individual tests to use continuous mode by setting the variable, either via --test_env or the env attribute. Closes bazelbuild#15166. PiperOrigin-RevId: 454558752 Change-Id: Id03d00d0644742e336feab41ea479d7d8527f6c4 Co-authored-by: Fabian Meumertzheim <[email protected]>
LLVM's profile instrumentation offers a continuous mode in which
counters are continuously synced to a file rather than being dumped
once in an exit hook. This is useful for coverage runs that include
binaries that exit abnormally (e.g. in failure tests), but may require
additional compiler flags and can negatively impact runtime performance
and memory usage.
Enabling continuous mode requires adding the "%c" modifier to the value
of the LLVM_PROFILE_FILE environment variable. With this commit, the
collect_coverage.sh script adds the modifier if the test environment has
the variable LLVM_PROFILE_CONTINUOUS_MODE set. This allows both all and
individual tests to use continuous mode by setting the variable, either
via --test_env or the env attribute.