Skip to content

Commit 7de1174

Browse files
committed
update rust-dev-guide to point about new command execution summary report under bootstrap profiling section
1 parent eac1ed5 commit 7de1174

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/doc/rustc-dev-guide/src/building/bootstrapping/debugging-bootstrap.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,10 +168,17 @@ For `#[instrument]`, it's recommended to:
168168

169169
### Profiling bootstrap
170170

171-
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.
171+
You can set the `BOOTSTRAP_PROFILE=1` environment variable to enable command execution profiling during bootstrap. This generates:
172+
173+
* A Chrome trace file (for visualization in `chrome://tracing` or [Perfetto](https://ui.perfetto.dev)) if tracing is enabled via `BOOTSTRAP_TRACING=COMMAND=trace`
174+
* A plain-text summary file, `bootstrap-profile-{pid}.txt`, listing all commands sorted by execution time (slowest first), along with cache hits and working directories
175+
176+
Note: the `.txt` report is always generated when `BOOTSTRAP_PROFILE=1` is set — tracing is not required.
177+
178+
Example usage:
172179

173180
```bash
174-
$ BOOTSTRAP_TRACING=COMMAND=trace BOOTSTRAP_PROFILE=1 ./x build library
181+
$ BOOTSTRAP_PROFILE=1 BOOTSTRAP_TRACING=COMMAND=trace ./x build library
175182
```
176183

177184
### rust-analyzer integration?

0 commit comments

Comments
 (0)