Skip to content

Optionally enable LLVM profile continuous mode#15782

Merged
ckolli5 merged 1 commit intobazelbuild:release-5.3.0from
ckolli5:ck/cherrypick-15166
Jun 30, 2022
Merged

Optionally enable LLVM profile continuous mode#15782
ckolli5 merged 1 commit intobazelbuild:release-5.3.0from
ckolli5:ck/cherrypick-15166

Conversation

@ckolli5
Copy link
Copy Markdown

@ckolli5 ckolli5 commented Jun 30, 2022

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

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
@ckolli5 ckolli5 merged commit aedca1d into bazelbuild:release-5.3.0 Jun 30, 2022
fmeum added a commit to fmeum/bazel that referenced this pull request Jul 2, 2022
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants