Skip to content

Commit 9a463df

Browse files
nikomatsakismark-i-m
authored andcommitted
don't write rust-prof bur rather `<toolchain>
1 parent 37aa15e commit 9a463df

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/profiling/with_perf.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ This is a guide for how to profile rustc with [perf](https://perf.wiki.kernel.or
1111
- `use-jemalloc = false` — lets you do memory use profiling with valgrind
1212
- leave everything else the defaults
1313
- Run `./x.py build` to get a full build
14-
- Make a rustup toolchain (let's call it `rust-prof`) pointing to that result
14+
- Make a rustup toolchain pointing to that result
1515
- see [the "build and run" section for instructions](../how-to-build-and-run.html#toolchain)
1616

1717
## Gathering a perf profile
@@ -37,10 +37,11 @@ to get call-graph information from debuginfo, which is accurate. The
3737
do:
3838

3939
```
40-
perf record -F99 --call-graph dwarf cargo +rust-prof rustc
40+
perf record -F99 --call-graph dwarf cargo +<toolchain> rustc
4141
```
4242

43-
to run `cargo`. But there are some things to be aware of:
43+
to run `cargo` -- here `<toolchain>` should be the name of the toolchain
44+
you made in the beginning. But there are some things to be aware of:
4445

4546
- You probably don't want to profile the time spend building
4647
dependencies. So something like `cargo build; cargo clean -p $C` may
@@ -77,10 +78,13 @@ build the dependencies:
7778

7879
```bash
7980
# Setup: first clean out any old results and build the dependencies:
80-
> cargo +rust-prof clean
81-
> CARGO_INCREMENTAL=0 cargo +rust-prof check
81+
> cargo +<toolchain> clean
82+
> CARGO_INCREMENTAL=0 cargo +<toolchain> check
8283
```
8384

85+
(Again, `<toolchain>` should be replaced with the name of the
86+
toolchain we made in the first step.)
87+
8488
Next: we want record the execution time for *just* the clap-rs crate,
8589
running cargo check. I tend to use `cargo rustc` for this, since it
8690
also allows me to add explicit flags, which we'll do later on.

0 commit comments

Comments
 (0)