From 325022270a6d28c17e1751bb558d6fbd1725738d Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Fri, 7 Sep 2018 11:07:56 -0400 Subject: [PATCH] add a note about the collector executable --- src/profiling/with_perf.md | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/src/profiling/with_perf.md b/src/profiling/with_perf.md index cec17d34..498dc139 100644 --- a/src/profiling/with_perf.md +++ b/src/profiling/with_perf.md @@ -62,9 +62,35 @@ do that, the first step is to clone [rustc-perf-gh]: https://github.com/rust-lang-nursery/rustc-perf -This repo contains a bunch of stuff, but the sources for the tests are -found in [the `collector/benchmarks` directory][dir]. So let's go into -the directory of a specific test; we'll use `clap-rs` as an example: +#### Doing it the easy way + +Once you've cloned the repo, you can use the `collector` executable to +do profiling for you! You can find +[instructions in the rustc-perf readme][rustc-perf-readme]. + +[rustc-perf-readme]: https://github.com/rust-lang-nursery/rustc-perf/blob/master/collector/README.md#profiling + +For example, to measure the clap-rs test, you might do: + +``` +> ./target/release/collector \ + --output-repo /path/to/place/output \ + profile perf-record + --rustc /path/to/rustc/executable/from/your/build/directory + --cargo `which cargo` + --filter clap-rs + --builds Check +``` + +You can also use that same command to use cachegrind or other profiling tools. + +#### Doing it the hard way + +If you prefer to run things manually, that is also possible. You first +need to find the source for the test you want. Sources for the tests +are found in [the `collector/benchmarks` directory][dir]. So let's go +into the directory of a specific test; we'll use `clap-rs` as an +example: [dir]: https://github.com/rust-lang-nursery/rustc-perf/tree/master/collector/benchmarks