Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support instrumenting only selected files or functions with -Z instrument-coverage #84943

Open
petrhosek opened this issue May 5, 2021 · 2 comments
Labels
A-code-coverage Area: Source-based code coverage (-Cinstrument-coverage) C-enhancement Category: An issue proposing an enhancement or a PR with one.

Comments

@petrhosek
Copy link
Contributor

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 the noprofile 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.

@Urgau
Copy link
Member

Urgau commented May 5, 2021

cc @richkadel You were right in #84875

@rustbot label +A-code-coverage +C-enhancement +requires-nightly

@rustbot rustbot added A-code-coverage Area: Source-based code coverage (-Cinstrument-coverage) C-enhancement Category: An issue proposing an enhancement or a PR with one. requires-nightly This issue requires a nightly compiler in some way. labels May 5, 2021
@taiki-e
Copy link
Member

taiki-e commented Jul 12, 2023

@rustbot label -requires-nightly

(instrument-coverage has been stabilized)

@rustbot rustbot removed the requires-nightly This issue requires a nightly compiler in some way. label Jul 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-code-coverage Area: Source-based code coverage (-Cinstrument-coverage) C-enhancement Category: An issue proposing an enhancement or a PR with one.
Projects
None yet
Development

No branches or pull requests

4 participants