-
Notifications
You must be signed in to change notification settings - Fork 14.1k
Uniform enter_trace_span! and add documentation
#144688
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
Merged
Merged
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
8e78616
Uniform enter_trace_span! and add documentation
Stypox 3b5fec0
Use new enter_trace_span! syntax for layout_of & friends
Stypox e1f674c
Use specific name for "frame" span field
Stypox bb08a4d
Make Miri's enter_trace_span! call const_eval's
Stypox File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we duplicate this macro between Miri and rustc? Can we reuse the rustc definition in Miri?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because from Miri we use
#[cfg(feature = "tracing")]to decide whether to do tracing or not, and fromrustc_const_evalwe instead have to callMachine::enter_trace_spanand let it decide whether to do tracing or not. I guess we could make the Miri macro passMiriMachine<'static>as$machineto this macro and then it would work, but#[cfg(feature = "tracing")]will probably optimize things out better than a call toMachine::enter_trace_span.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm... then please add that as a comment in the Miri version of the macro.
It may be worth briefly benchmarking (
./miri bench, not the option to save/load a baseline file) whether it makes any difference to use the rustc version from Miri -- but that doesn't have to block this PR.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did the benchmarks in the end and it seems like there is no difference (the differences are all within statistical significance, and some are higher some lower). So I pushed a commit that makes the Miri one just call the rustc_const_eval one.
Benchmark of #[cfg(feature = "tracing")]
Benchmark of deferring to rustc_const_eval::enter_trace_span!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, you're just too fast, okay. :D
(It's easier to compare these benchmarks if you use
--save-baseline/--load-baseline.)