Support instrumenting only selected files or functions with -Z instrument-coverage #84943
Labels
A-code-coverage
Area: Source-based code coverage (-Cinstrument-coverage)
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
Sometimes it’s useful to only instrument certain files or functions. For example in automated testing infrastructure, it may be desirable to only instrument files or functions that were modified by a patch to reduce the overhead of instrumenting a full system.
Clang supports this via the
-fprofile-list==<pathname>
option where the argument is a file in the Sanitizer special case list format which selects which files and functions to instrument. At the IR level, for any function that's not instrumented, Clang attaches thenoprofile
attribute.It'd be useful if Rust supported the same option. It'd be also nice if Rust could use the same file format but it's not strictly necessary.
The text was updated successfully, but these errors were encountered: