Skip to content

Commit 804f50e

Browse files
committed
Fix profiling with samply.
samply now produces gzipped output files -- `profile.json.gz` instead of `profile.json`. This commit updates the code to handle them.
1 parent 3982771 commit 804f50e

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

collector/src/compile/execute/profiler.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -250,11 +250,13 @@ impl Processor for ProfileProcessor<'_> {
250250
}
251251

252252
// Samply produces (via rustc-fake) a data file called
253-
// `profile.json`. We copy it from the temp dir to the output dir,
254-
// giving it a new name in the process.
253+
// `profile.json.gz`. We copy it from the temp dir to the output dir,
254+
// giving it a new name in the process. The new name must end
255+
// in `.gz` for `samply load` to handle it.
255256
Profiler::Samply => {
256-
let tmp_samply_file = filepath(data.cwd, "profile.json");
257-
let samply_file = filepath(self.output_dir, &out_file("samply"));
257+
let tmp_samply_file = filepath(data.cwd, "profile.json.gz");
258+
let samply_file =
259+
filepath(self.output_dir, &format!("{}.gz", out_file("samply")));
258260

259261
fs::copy(tmp_samply_file, samply_file)?;
260262
}

0 commit comments

Comments
 (0)