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: Be more strict about what counts as a "visible macro" #118595

Merged
merged 2 commits into from
Dec 6, 2023

Conversation

Zalathar
Copy link
Contributor

@Zalathar Zalathar commented Dec 4, 2023

This is a follow-up to the workaround in #117827, and I believe it now properly fixes #117788.

The old code treats a span as having a “visible macro” if it is part of a macro-expansion, and its parent callsite's context is the same as the body span's context. But if the body span is itself part of an expansion, the macro in question might not actually be visible from the body span. That results in the macro name's length being meaningless as a span offset.

We now only consider spans whose parent callsite is the same as the source callsite, i.e. the parent has no parent.


I've also included some related cleanup for the code added by #117827. That code was more complicated than normal, because I wanted it to be easy to backport to stable/beta.

@rustbot
Copy link
Collaborator

rustbot commented Dec 4, 2023

r? @TaKO8Ki

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Dec 4, 2023
@rustbot
Copy link
Collaborator

rustbot commented Dec 4, 2023

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

@Zalathar
Copy link
Contributor Author

Zalathar commented Dec 4, 2023

@rustbot label +A-code-coverage

@rustbot rustbot added the A-code-coverage Area: Source-based code coverage (-Cinstrument-coverage) label Dec 4, 2023
@Zalathar Zalathar force-pushed the visible-macro branch 2 times, most recently from 1337501 to a1b0bf1 Compare December 5, 2023 02:37
@TaKO8Ki
Copy link
Member

TaKO8Ki commented Dec 5, 2023

Thanks. @bors r+

@bors
Copy link
Contributor

bors commented Dec 5, 2023

📌 Commit 242bff3 has been approved by TaKO8Ki

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 Dec 5, 2023
@bors
Copy link
Contributor

bors commented Dec 6, 2023

⌛ Testing commit 242bff3 with merge 6316ac8...

@bors
Copy link
Contributor

bors commented Dec 6, 2023

☀️ Test successful - checks-actions
Approved by: TaKO8Ki
Pushing 6316ac8 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Dec 6, 2023
@bors bors merged commit 6316ac8 into rust-lang:master Dec 6, 2023
12 checks passed
@rustbot rustbot added this to the 1.76.0 milestone Dec 6, 2023
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (6316ac8): comparison URL.

Overall result: ❌ regressions - no action needed

@rustbot label: -perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
1.2% [1.2%, 1.2%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
3.7% [3.7%, 3.7%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 674.182s -> 675.976s (0.27%)
Artifact size: 314.16 MiB -> 314.13 MiB (-0.01%)

@Zalathar Zalathar deleted the visible-macro branch December 6, 2023 21:11
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) merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

Malformed coverage data with a no_mangle function
6 participants