-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Improve tracing in bootstrap #145261
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
Open
Kobzol
wants to merge
17
commits into
rust-lang:master
Choose a base branch
from
Kobzol:bootstrap-tracing
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Improve tracing in bootstrap #145261
+685
−407
Conversation
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
So that it is easier to see which was the last started step when a failure happens on CI.
When verbose mode is enabled, it is very hard to see the actually executed steps.
They could easily get out of sync and miss some fields. Now all steps are instrumented automatically.
This PR changes how LLVM is built. Consider updating src/bootstrap/download-ci-llvm-stamp. The rustc-dev-guide subtree was changed. If this PR only touches the dev guide consider submitting a PR directly to rust-lang/rustc-dev-guide otherwise thank you for updating the dev guide with your changes. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-rustc-dev-guide
Area: rustc-dev-guide
A-testsuite
Area: The testsuite used to check the correctness of rustc
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
T-bootstrap
Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
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.
I was annoyed that bootstrap had like 5 separate ways of debugging/tracing/profiling, and it was hard for me to understand how are individual steps executed. This PR tries to unify severla things behind
BOOTSTRAP_TRACING
, and improve tracing/profiling in general:latest
symlink to the latest generated tracing output directory for convenience.#[tracing::instrument]
).tracing_forest
was removed. While it did some useful postprocessing, it didn't expose enough information for making the dynamic step spans work.STEP=info
) and/or commands (COMMAND=info
), to have more granular control over what gets logged.print-step-timings
also show when a step starts its execution (not just when it ends it), so that when some step fails in CI, we can actually see what step it was (before we would only see the end of the previous step).There are still some things that work outside of tracing (
print-step-timings
anddump-bootstrap-shims
), but I think that for now this improvement is good enough.I removed the
> step
,< step
verbose output, because I found it unusable, as verbose bootstrap output also enables verbose Cargo output, and then you simply drown in too much data, and because I think that the new tracing system makes it obsolete (although it does require recompilation with thetracing
feature). If you want to keep it, happy to revert 690c781. And the information about cached steps is now also shown in the Graphviz step dependency graph.We can modify the tracing output however we want, as we now implement it ourselves. Notably, we could also show exit logs for step spans, currently I only show enter spans. Maybe creating indents for each executed nested command is also not needed. Happy to hear feedback!
Some further improvements could be to print step durations, if we decide to also log step exit events. We could also try to enable tracing in CI logs, but it might be too verbose.
Best reviewed commit-by-commit.
r? @jieyouxu
CC @Shourya742