Skip to content

runtime/coverage: Support set mode #75288

@r-hang

Description

@r-hang

Go's coverageredesign in a non unit set setting enforces that the program be instrumented in atomic coverage mode.
-

return fmt.Errorf("WriteCountersDir invoked for program built with -covermode=%s (please use -covermode=atomic)", cmode.String())

Can we support set mode and provide performance estimates for for atomic mode? https://go.dev/blog/cover states that set mode can incur ~3% overhead.

One possible application of this feature is deploying coverage instrumented binaries in production in order to detect and remove unused code. Atomic mode is prohibitively expensive to do on some production workloads.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FeatureRequestIssues asking for a new feature that does not need a proposal.NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.compiler/runtimeIssues related to the Go compiler and/or runtime.

    Type

    No type

    Projects

    Status

    Todo

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions