From 804f50ea477257febd4b5c2fadbf20d9f3ca4aab Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Tue, 19 Aug 2025 09:31:06 +1000 Subject: [PATCH] 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. --- collector/src/compile/execute/profiler.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/collector/src/compile/execute/profiler.rs b/collector/src/compile/execute/profiler.rs index 069f6037d..59653fbad 100644 --- a/collector/src/compile/execute/profiler.rs +++ b/collector/src/compile/execute/profiler.rs @@ -250,11 +250,13 @@ impl Processor for ProfileProcessor<'_> { } // Samply produces (via rustc-fake) a data file called - // `profile.json`. We copy it from the temp dir to the output dir, - // giving it a new name in the process. + // `profile.json.gz`. We copy it from the temp dir to the output dir, + // giving it a new name in the process. The new name must end + // in `.gz` for `samply load` to handle it. Profiler::Samply => { - let tmp_samply_file = filepath(data.cwd, "profile.json"); - let samply_file = filepath(self.output_dir, &out_file("samply")); + let tmp_samply_file = filepath(data.cwd, "profile.json.gz"); + let samply_file = + filepath(self.output_dir, &format!("{}.gz", out_file("samply"))); fs::copy(tmp_samply_file, samply_file)?; }