Skip to content

Commit c790398

Browse files
nnethercoteMark-Simulacrum
authored andcommitted
Fix documentation errors, and create output dir for profile if necessary.
1 parent 1f5830f commit c790398

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

collector/README.md

+12-6
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,9 @@ and visit `localhost:2346/compare.html` in a web browser.
146146
Wait for the "Loading complete" message; it should come within a couple dozen
147147
seconds (or faster, depending on how much data you've collected).
148148

149+
Enter the IDs for two runs in the "Commit/Date A" and "Commit/Date B" text
150+
boxes (the two IDs can be the same) and click on "Submit".
151+
149152
If you've collected new data, you can run `curl -X POST
150153
localhost:2346/perf/onpush` to update the site's view of the data, or just
151154
restart the server.
@@ -186,20 +189,23 @@ Without this you won't get useful file names and line numbers in the output.
186189

187190
To self-profile a local build:
188191
```
189-
./target/release/collector --output-repo $OUTPUT_DIR --self-profile \
190-
bench_local $PROFILER --rustc $RUSTC --cargo $CARGO $ID
192+
./target/release/collector --db $DATABASE --self-profile \
193+
bench_local --rustc $RUSTC --cargo $CARGO $ID
191194
```
192195

193196
Then view the results the same way as for the `bench_local` subcommand.
194197

195198
To profile a local build with a different profiler:
196199
```
197-
./target/release/collector --output-repo $OUTPUT_DIR \
198-
profile $PROFILER --rustc $RUSTC --cargo $CARGO $ID
200+
./target/release/collector profile $PROFILER \
201+
--output $OUTPUT_DIR --rustc $RUSTC --cargo $CARGO $ID
199202
```
200203

201-
All the parts of this command are the same as for the `bench_local` subcommand,
202-
except that `$PROFILER` is one of the following.
204+
This is similar to the `bench_local` subcommand, with a couple of exceptions.
205+
First, `$OUTPUT_DIR` is a directory in which the output will be placed. If the
206+
directory doesn't exist, it will be created.
207+
208+
Second, `$PROFILER` is one of the following.
203209
- `self-profile`: Profile with rustc's `-Zself-profile`.
204210
- **Purpose**. This gives multiple high-level views of compiler performance,
205211
in both tabular and graphical form.

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

+2
Original file line numberDiff line numberDiff line change
@@ -616,6 +616,8 @@ impl<'a> Processor for ProfileProcessor<'a> {
616616
data: &ProcessOutputData<'_>,
617617
output: process::Output,
618618
) -> anyhow::Result<Retry> {
619+
fs::create_dir_all(self.output_dir)?;
620+
619621
// Produce a name of the form $PREFIX-$ID-$BENCHMARK-$BUILDKIND-$RUNKIND.
620622
let out_file = |prefix: &str| -> String {
621623
format!(

0 commit comments

Comments
 (0)