Skip to content

Commit 12d7eea

Browse files
committed
Auto merge of #137010 - workingjubilee:rollup-g00c07v, r=workingjubilee
Rollup of 9 pull requests Successful merges: - #135439 (Make `-O` mean `OptLevel::Aggressive`) - #136460 (Simplify `rustc_span` `analyze_source_file`) - #136904 (add `IntoBounds` trait) - #136908 ([AIX] expect `EINVAL` for `pthread_mutex_destroy`) - #136924 (Add profiling of bootstrap commands using Chrome events) - #136951 (Use the right binder for rebinding `PolyTraitRef`) - #136981 (ci: switch loongarch jobs to free runners) - #136992 (Update backtrace) - #136993 ([cg_llvm] Remove dead error message) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 892a0ee + 9297af1 commit 12d7eea

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/building/bootstrapping/debugging-bootstrap.md

+8
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,14 @@ For `#[instrument]`, it's recommended to:
121121
- Explicitly pick an instrumentation name via `name = ".."` to distinguish between e.g. `run` of different steps.
122122
- Take care to not cause diverging behavior via tracing, e.g. building extra things only when tracing infra is enabled.
123123

124+
### Profiling bootstrap
125+
126+
You can use the `COMMAND` tracing target to trace execution of most commands spawned by bootstrap. If you also use the `BOOTSTRAP_PROFILE=1` environment variable, bootstrap will generate a Chrome JSON trace file, which can be visualized in Chrome's `chrome://tracing` page or on https://ui.perfetto.dev.
127+
128+
```bash
129+
$ BOOTSTRAP_TRACING=COMMAND=trace BOOTSTRAP_PROFILE=1 ./x build library
130+
```
131+
124132
### rust-analyzer integration?
125133

126134
Unfortunately, because bootstrap is a `rust-analyzer.linkedProjects`, you can't ask r-a to check/build bootstrap itself with `tracing` feature enabled to get relevant completions, due to lack of support as described in <https://github.com/rust-lang/rust-analyzer/issues/8521>.

0 commit comments

Comments
 (0)