Skip to content

Commit c2e35ab

Browse files
committed
Tweak the perf-record invocation.
Specifically: triple the sampling freqency, and collect both cycles and instructions. Also mention Hotspot for viewing perf profiles.
1 parent 5f1659e commit c2e35ab

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

collector/README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,8 @@ except that `$PROFILER` is one of the following.
229229
where execution time is spent and finding hot functions.
230230
- **Slowdown**. Negligible.
231231
- **Output**. Binary output is written to files with a `perf` prefix. Those
232-
files can be read with `perf-report` and other similar `perf` commands.
232+
files can be read with `perf-report` and other similar `perf` commands, or
233+
with the excellent [Hotspot](https://github.com/KDAB/hotspot) viewer.
233234
- `oprofile`: Profile with [OProfile](http://oprofile.sourceforge.net/), a
234235
sampling profiler.
235236
- **Purpose**. OProfile is a general-purpose profiler, good for seeing

collector/src/bin/rustc-fake.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@ fn main() {
104104
cmd.arg("record")
105105
.arg("--call-graph=dwarf")
106106
.arg("--output=perf")
107-
.arg("--freq=99")
107+
.arg("--freq=299")
108+
.arg("--event=cycles:u,instructions:u")
108109
.arg(&rustc)
109110
.args(&args);
110111

0 commit comments

Comments
 (0)