Skip to content

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

Open
@petrhosek

Description

@petrhosek

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-code-coverageArea: Source-based code coverage (-Cinstrument-coverage)C-enhancementCategory: An issue proposing an enhancement or a PR with one.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions