Skip to content

Commit e140dfe

Browse files
committed
Use --show-percs with Cachegrind and Callgrind.
1 parent fb4c736 commit e140dfe

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

collector/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ except that `$PROFILER` is one of the following.
244244
often results in success.
245245
- `cachegrind`: Profile with
246246
[Cachegrind](http://valgrind.org/docs/manual/cg-manual.html), a tracing
247-
profiler.
247+
profiler. Requires Valgrind 3.15 or later.
248248
- **Purpose**. Cachegrind provides global, per-function, and per-source-line
249249
instruction counts. This fine-grained information can be extremely useful.
250250
Cachegrind's results are almost deterministic, which eases comparisons
@@ -263,7 +263,7 @@ except that `$PROFILER` is one of the following.
263263
`--mod-filename='s/rust[01]/rustN/g'` to eliminate path differences.
264264
- `callgrind`: Profile with
265265
[Callgrind](http://valgrind.org/docs/manual/cl-manual.html), a tracing
266-
profiler.
266+
profiler. Requires Valgrind 3.15 or later.
267267
- **Purpose**. Callgrind collects the same information as Cachegrind, plus
268268
function call information. So it can be used like either Cachegrind or
269269
`perf-record`. However, it cannot perform diffs between profiles.

collector/src/bin/rustc-perf-collector/execute.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,10 @@ impl<'a> Processor for ProfileProcessor<'a> {
577577
fs::copy(&tmp_cgout_file, &cgout_file)?;
578578

579579
let mut cg_annotate_cmd = Command::new("cg_annotate");
580-
cg_annotate_cmd.arg("--auto=yes").arg(&cgout_file);
580+
cg_annotate_cmd
581+
.arg("--auto=yes")
582+
.arg("--show-percs=yes")
583+
.arg(&cgout_file);
581584
let output = cg_annotate_cmd.output()?;
582585

583586
fs::write(cgann_file, &output.stdout)?;
@@ -595,7 +598,10 @@ impl<'a> Processor for ProfileProcessor<'a> {
595598
fs::copy(&tmp_clgout_file, &clgout_file)?;
596599

597600
let mut clg_annotate_cmd = Command::new("callgrind_annotate");
598-
clg_annotate_cmd.arg("--auto=yes").arg(&clgout_file);
601+
clg_annotate_cmd
602+
.arg("--auto=yes")
603+
.arg("--show-percs=yes")
604+
.arg(&clgout_file);
599605
let output = clg_annotate_cmd.output()?;
600606

601607
fs::write(clgann_file, &output.stdout)?;

0 commit comments

Comments
 (0)