diff options
| author | The Miri Cronjob Bot <miri@cron.bot> | 2025-07-14 05:07:40 +0000 |
|---|---|---|
| committer | The Miri Cronjob Bot <miri@cron.bot> | 2025-07-14 05:07:40 +0000 |
| commit | 8812d741eb54c58ee1b9bf6bd69e60f08bba941a (patch) | |
| tree | 57b04ecd511abfddf715b5605fc0e091a7792d16 /src/doc/rustc-dev-guide | |
| parent | dbeb05cd2addf012e6c1e1ddea00a5e6fb8ca609 (diff) | |
| parent | 9c3064e131f4939cc95a29bb11413c49bbda1491 (diff) | |
| download | rust-8812d741eb54c58ee1b9bf6bd69e60f08bba941a.tar.gz rust-8812d741eb54c58ee1b9bf6bd69e60f08bba941a.zip | |
Merge from rustc
Diffstat (limited to 'src/doc/rustc-dev-guide')
| -rw-r--r-- | src/doc/rustc-dev-guide/src/building/bootstrapping/debugging-bootstrap.md | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/doc/rustc-dev-guide/src/building/bootstrapping/debugging-bootstrap.md b/src/doc/rustc-dev-guide/src/building/bootstrapping/debugging-bootstrap.md index ed267850401..c9c0d64a604 100644 --- a/src/doc/rustc-dev-guide/src/building/bootstrapping/debugging-bootstrap.md +++ b/src/doc/rustc-dev-guide/src/building/bootstrapping/debugging-bootstrap.md @@ -168,10 +168,17 @@ For `#[instrument]`, it's recommended to: ### Profiling bootstrap -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. +You can set the `BOOTSTRAP_PROFILE=1` environment variable to enable command execution profiling during bootstrap. This generates: + +* A Chrome trace file (for visualization in `chrome://tracing` or [Perfetto](https://ui.perfetto.dev)) if tracing is enabled via `BOOTSTRAP_TRACING=COMMAND=trace` +* 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 + +Note: the `.txt` report is always generated when `BOOTSTRAP_PROFILE=1` is set — tracing is not required. + +Example usage: ```bash -$ BOOTSTRAP_TRACING=COMMAND=trace BOOTSTRAP_PROFILE=1 ./x build library +$ BOOTSTRAP_PROFILE=1 BOOTSTRAP_TRACING=COMMAND=trace ./x build library ``` ### rust-analyzer integration? |
