Skip to content

Add tracking of query call locations#154402

Draft
Zoxc wants to merge 5 commits intorust-lang:mainfrom
Zoxc:query-call-tracking
Draft

Add tracking of query call locations#154402
Zoxc wants to merge 5 commits intorust-lang:mainfrom
Zoxc:query-call-tracking

Conversation

@Zoxc
Copy link
Copy Markdown
Contributor

@Zoxc Zoxc commented Mar 26, 2026

This adds tracking of query call locations using #[track_caller] in additional to associating query calls with a span.

Query call locations are printed for query panic stack traces and for -Z verbose-internals. The latter being helpful to track down accidental query cycles.

@rustbot rustbot added A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) 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. labels Mar 26, 2026
@rust-log-analyzer

This comment has been minimized.

@Zoxc Zoxc force-pushed the query-call-tracking branch from f641c01 to 4197e18 Compare March 26, 2026 05:53
@rust-log-analyzer

This comment has been minimized.

@Zoxc Zoxc force-pushed the query-call-tracking branch from 4197e18 to 3ac1303 Compare March 26, 2026 08:00
@Zoxc
Copy link
Copy Markdown
Contributor Author

Zoxc commented Mar 26, 2026

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Mar 26, 2026
rust-bors bot pushed a commit that referenced this pull request Mar 26, 2026
Add tracking of query call locations
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors bot commented Mar 26, 2026

☀️ Try build successful (CI)
Build commit: e18d7fc (e18d7fcbe3f871aec31f0224187f0c39cf3a264a, parent: 3ea2fbcb2a872b7e1fa3cada256f8e97f9e6636f)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (e18d7fc): comparison URL.

Overall result: ❌ regressions - please read the text below

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please do so in sufficient writing along with @rustbot label: +perf-regression-triaged. If not, please fix the regressions and do another perf run. If its results are neutral or positive, the label will be automatically removed.

@bors rollup=never
@rustbot label: -S-waiting-on-perf +perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
0.4% [0.1%, 1.1%] 105
Regressions ❌
(secondary)
0.4% [0.1%, 1.6%] 121
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.4% [0.1%, 1.1%] 105

Max RSS (memory usage)

Results (secondary -1.5%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
5.2% [4.8%, 5.7%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-6.0% [-6.2%, -5.5%] 3
All ❌✅ (primary) - - 0

Cycles

Results (secondary 0.9%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

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

Binary size

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

Bootstrap: 485.545s -> 486.608s (0.22%)
Artifact size: 395.12 MiB -> 395.40 MiB (0.07%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Mar 26, 2026
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors bot commented Mar 29, 2026

☔ The latest upstream changes (presumably #154304) made this pull request unmergeable. Please resolve the merge conflicts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) perf-regression Performance regression. 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.

4 participants