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

coverage: Include the highest counter ID seen in .cov-map dumps #131476

Merged
merged 1 commit into from
Oct 11, 2024

Conversation

Zalathar
Copy link
Contributor

When making changes that have a large impact on coverage counter creation, this makes it easier to see whether the number of physical counters has changed.

(The highest counter ID seen in coverage maps is not necessarily the same as the number of physical counters actually used by the instrumented code, but it's the best approximation we can get from looking only at the coverage maps, and it should be reasonably accurate in most cases.)

Extracted from #131398, since I'm still considering whether to make those changes as-is, whereas this PR is useful and good on its own.

@Zalathar Zalathar added the A-code-coverage Area: Source-based code coverage (-Cinstrument-coverage) label Oct 10, 2024
@rustbot
Copy link
Collaborator

rustbot commented Oct 10, 2024

r? @Mark-Simulacrum

rustbot has assigned @Mark-Simulacrum.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 10, 2024
@Zalathar
Copy link
Contributor Author

One of the motivations behind this is that it's really easy to make changes that make the coverage mappings “simpler” (by using fewer expressions), at the expense of making them use more physical counters. That's not necessarily a good tradeoff, and without this extra summary it's hard to notice the downside.

@Zalathar Zalathar added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Oct 11, 2024
Copy link
Member

@jieyouxu jieyouxu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAICT this seems reasonable. Thanks!

@jieyouxu jieyouxu assigned jieyouxu and unassigned Mark-Simulacrum Oct 11, 2024
@jieyouxu
Copy link
Member

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Oct 11, 2024

📌 Commit a9fe2f7 has been approved by jieyouxu

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 11, 2024
Zalathar added a commit to Zalathar/rust that referenced this pull request Oct 11, 2024
coverage: Include the highest counter ID seen in `.cov-map` dumps

When making changes that have a large impact on coverage counter creation, this makes it easier to see whether the number of physical counters has changed.

(The highest counter ID seen in coverage maps is not necessarily the same as the number of physical counters actually used by the instrumented code, but it's the best approximation we can get from looking only at the coverage maps, and it should be reasonably accurate in most cases.)

Extracted from rust-lang#131398, since I'm still considering whether to make those changes as-is, whereas this PR is useful and good on its own.
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 11, 2024
…iaskrgr

Rollup of 5 pull requests

Successful merges:

 - rust-lang#131464 (Update wasm-component-ld to 0.5.10)
 - rust-lang#131498 (Consider outermost const-anon in `non_local_def` lint)
 - rust-lang#131512 (Fixing rustDoc for LayoutError.)
 - rust-lang#131529 (rustdoc-json-types: fix typo in comment)
 - rust-lang#131531 (move dummy commit logic into x86_64-gnu-llvm-18)

Failed merges:

 - rust-lang#131476 (coverage: Include the highest counter ID seen in `.cov-map` dumps)

r? `@ghost`
`@rustbot` modify labels: rollup
When making changes that have a large impact on coverage counter creation, this
makes it easier to see whether the number of physical counters has changed.

(The highest counter ID seen in coverage maps is not necessarily the same as
the number of physical counters actually used by the instrumented code, but
it's the best approximation we can get from looking only at the coverage maps,
and it should be reasonably accurate in most cases.)
@Zalathar
Copy link
Contributor Author

Rebased/blessed to resolve trivial conflict with #131524.

@bors r=jieyouxu

@bors
Copy link
Contributor

bors commented Oct 11, 2024

📌 Commit 599f95e has been approved by jieyouxu

It is now in the queue for this repository.

bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 11, 2024
…iaskrgr

Rollup of 6 pull requests

Successful merges:

 - rust-lang#131464 (Update wasm-component-ld to 0.5.10)
 - rust-lang#131476 (coverage: Include the highest counter ID seen in `.cov-map` dumps)
 - rust-lang#131497 (Add myself to bootstrap review rotation)
 - rust-lang#131498 (Consider outermost const-anon in `non_local_def` lint)
 - rust-lang#131512 (Fixing rustDoc for LayoutError.)
 - rust-lang#131529 (rustdoc-json-types: fix typo in comment)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit c319be2 into rust-lang:master Oct 11, 2024
6 checks passed
@rustbot rustbot added this to the 1.83.0 milestone Oct 11, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Oct 11, 2024
Rollup merge of rust-lang#131476 - Zalathar:highest-counter, r=jieyouxu

coverage: Include the highest counter ID seen in `.cov-map` dumps

When making changes that have a large impact on coverage counter creation, this makes it easier to see whether the number of physical counters has changed.

(The highest counter ID seen in coverage maps is not necessarily the same as the number of physical counters actually used by the instrumented code, but it's the best approximation we can get from looking only at the coverage maps, and it should be reasonably accurate in most cases.)

Extracted from rust-lang#131398, since I'm still considering whether to make those changes as-is, whereas this PR is useful and good on its own.
@tgross35
Copy link
Contributor

@bors r- still shows up in the queue

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Oct 11, 2024
@Zalathar Zalathar deleted the highest-counter branch October 11, 2024 22:39
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) S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants