Skip to content

Commit fcbd9b9

Browse files
nikomatsakismark-i-m
authored andcommitted
add a note about the collector executable
1 parent 85ed2e3 commit fcbd9b9

File tree

1 file changed

+29
-3
lines changed

1 file changed

+29
-3
lines changed

src/profiling/with_perf.md

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,35 @@ do that, the first step is to clone
6262

6363
[rustc-perf-gh]: https://github.com/rust-lang-nursery/rustc-perf
6464

65-
This repo contains a bunch of stuff, but the sources for the tests are
66-
found in [the `collector/benchmarks` directory][dir]. So let's go into
67-
the directory of a specific test; we'll use `clap-rs` as an example:
65+
#### Doing it the easy way
66+
67+
Once you've cloned the repo, you can use the `collector` executable to
68+
do profiling for you! You can find
69+
[instructions in the rustc-perf readme][rustc-perf-readme].
70+
71+
[rustc-perf-readme]: https://github.com/rust-lang-nursery/rustc-perf/blob/master/collector/README.md#profiling
72+
73+
For example, to measure the clap-rs test, you might do:
74+
75+
```
76+
> ./target/release/collector \
77+
--output-repo /path/to/place/output \
78+
profile perf-record
79+
--rustc /path/to/rustc/executable/from/your/build/directory
80+
--cargo `which cargo`
81+
--filter clap-rs
82+
--builds Check
83+
```
84+
85+
You can also use that same command to use cachegrind or other profiling tools.
86+
87+
#### Doing it the hard way
88+
89+
If you prefer to run things manually, that is also possible. You first
90+
need to find the source for the test you want. Sources for the tests
91+
are found in [the `collector/benchmarks` directory][dir]. So let's go
92+
into the directory of a specific test; we'll use `clap-rs` as an
93+
example:
6894

6995
[dir]: https://github.com/rust-lang-nursery/rustc-perf/tree/master/collector/benchmarks
7096

0 commit comments

Comments
 (0)