@@ -11,7 +11,7 @@ This is a guide for how to profile rustc with [perf](https://perf.wiki.kernel.or
11
11
- ` use-jemalloc = false ` — lets you do memory use profiling with valgrind
12
12
- leave everything else the defaults
13
13
- 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
15
15
- see [ the "build and run" section for instructions] ( ../how-to-build-and-run.html#toolchain )
16
16
17
17
## Gathering a perf profile
@@ -37,10 +37,11 @@ to get call-graph information from debuginfo, which is accurate. The
37
37
do:
38
38
39
39
```
40
- perf record -F99 --call-graph dwarf cargo +rust-prof rustc
40
+ perf record -F99 --call-graph dwarf cargo +<toolchain> rustc
41
41
```
42
42
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:
44
45
45
46
- You probably don't want to profile the time spend building
46
47
dependencies. So something like ` cargo build; cargo clean -p $C ` may
@@ -77,10 +78,13 @@ build the dependencies:
77
78
78
79
``` bash
79
80
# 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
82
83
```
83
84
85
+ (Again, ` <toolchain> ` should be replaced with the name of the
86
+ toolchain we made in the first step.)
87
+
84
88
Next: we want record the execution time for * just* the clap-rs crate,
85
89
running cargo check. I tend to use ` cargo rustc ` for this, since it
86
90
also allows me to add explicit flags, which we'll do later on.
0 commit comments