Skip to content

Commit f1e087d

Browse files
nikomatsakismark-i-m
authored andcommitted
switch to em-dash
1 parent 5571290 commit f1e087d

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

src/profiling/with_perf.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ This is a guide for how to profile rustc with [perf](https://perf.wiki.kernel.or
77
- Get a clean checkout of rust-lang/master, or whatever it is you want to profile.
88
- Set the following settings in your `config.toml`:
99
- `debuginfo-lines = true`
10-
- `use-jemalloc = false` -- lets you do memory use profiling with valgrind
10+
- `use-jemalloc = false` lets you do memory use profiling with valgrind
1111
- leave everything else the defaults
1212
- Run `./x.py build` to get a full build
1313
- Make a rustup toolchain (let's call it `rust-prof`) pointing to that result
@@ -117,7 +117,7 @@ the `cargo rustc` command, like so:
117117

118118
```bash
119119
touch src/lib.rs
120-
CARGO_INCREMENTAL=0 perf record -F99 --call-graph dwarf cargo rustc --profile check --lib -- -Zborrowck=mir
120+
CARGO_INCREMENTAL=0 perf record -F99 --call-graph dwarf cargo rustc --profile check --lib -Zborrowck=mir
121121
```
122122

123123
[pf]: https://github.com/nikomatsakis/perf-focus
@@ -178,7 +178,7 @@ samples where `do_mir_borrowck` was on the stack: in this case, 29%.
178178
currently executes `perf script` (perhaps there is a better
179179
way...). I've sometimes found that `perf script` outputs C++ mangled
180180
names. This is annoying. You can tell by running `perf script |
181-
head` yourself -- if you see names like `5rustc6middle` instead of
181+
head` yourself if you see names like `5rustc6middle` instead of
182182
`rustc::middle`, then you have the same problem. You can solve this
183183
by doing:
184184

@@ -191,7 +191,7 @@ should mostly convert those names into a more friendly format. The
191191
`--from-stdin` flag to `perf focus` tells it to get its data from
192192
stdin, rather than executing `perf focus`. We should make this more
193193
convenient (at worst, maybe add a `c++filt` option to `perf focus`, or
194-
just always use it -- it's pretty harmless).
194+
just always use it it's pretty harmless).
195195

196196
### Example: How much time does MIR borrowck spend solving traits?
197197

@@ -209,7 +209,7 @@ Percentage : 0%
209209
Here we used the `..` operator to ask "how often do we have
210210
`do_mir_borrowck` on the stack and then, later, some fn whose name
211211
begins with `rusc::traits`?" (basically, code in that module). It
212-
turns out the answer is "almost never" -- only 12 samples fit that
212+
turns out the answer is "almost never" only 12 samples fit that
213213
description (if you ever see *no* samples, that often indicates your
214214
query is messed up).
215215

@@ -264,7 +264,7 @@ function and not some callee of that function** (self). Usually
264264
### Relative percentages
265265

266266
By default, all in perf-focus are relative to the **total program
267-
execution**. This is useful to help you keep perspective -- often as
267+
execution**. This is useful to help you keep perspective often as
268268
we drill down to find hot spots, we can lose sight of the fact that,
269269
in terms of overall program execution, this "hot spot" is actually not
270270
important. It also ensures that percentages between different queries
@@ -273,7 +273,8 @@ are easily compared against one another.
273273
That said, sometimes it's useful to get relative percentages, so `perf
274274
focus` offers a `--relative` option. In this case, the percentages are
275275
listed only for samples that match (vs all samples). So for example we
276-
could get our percentages relative to the borrowck itself like so:
276+
could get our percentages relative to the borrowck itself
277+
like so:
277278

278279
```bash
279280
> perf focus '{do_mir_borrowck}' --tree-callees --relative --tree-max-depth 1 --tree-min-percent 5
@@ -290,7 +291,7 @@ Tree
290291
: | rustc_mir::dataflow::do_dataflow (8% total, 1% self) [...]
291292
```
292293
293-
Here you see that `compute_regions` came up as "47% total" -- that
294+
Here you see that `compute_regions` came up as "47% total" that
294295
means that 47% of `do_mir_borrowck` is spent in that function. Before,
295-
we saw 20% -- that's because `do_mir_borrowck` itself is only 43% of
296+
we saw 20% that's because `do_mir_borrowck` itself is only 43% of
296297
the total time (and `.47 * .43 = .20`).

0 commit comments

Comments
 (0)