Skip to content

Commit cd2b600

Browse files
authored
Merge pull request #2222 from nnethercote/fix-samply
Fix profiling with samply.
2 parents c02b7d8 + 804f50e commit cd2b600

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)