@@ -4,6 +4,7 @@ use crate::cli::UnwindingMode;
44use crate :: executor:: Config ;
55use crate :: executor:: helpers:: command:: CommandBuilder ;
66use crate :: executor:: helpers:: env:: is_codspeed_debug_enabled;
7+ use crate :: executor:: helpers:: harvest_perf_maps_for_pids:: harvest_perf_maps_for_pids;
78use crate :: executor:: helpers:: run_command_with_log_pipe:: run_command_with_log_pipe_and_callback;
89use crate :: executor:: helpers:: run_with_sudo:: run_with_sudo;
910use crate :: executor:: helpers:: run_with_sudo:: wrap_with_sudo;
@@ -264,6 +265,7 @@ pub struct BenchmarkData {
264265pub enum BenchmarkDataSaveError {
265266 MissingIntegration ,
266267 FailedToParsePerfFile ,
268+ FailedToHarvestPerfMaps ,
267269 FailedToHarvestJitDumps ,
268270}
269271
@@ -277,12 +279,14 @@ impl BenchmarkData {
277279
278280 let path_ref = path. as_ref ( ) ;
279281
280- debug ! ( "Reading perf data from file for mmap extraction" ) ;
281282 let pid_filter = if self . fifo_data . is_exec_harness ( ) {
282283 parse_perf_file:: PidFilter :: All
283284 } else {
284285 parse_perf_file:: PidFilter :: TrackedPids ( self . fifo_data . bench_pids . clone ( ) )
285286 } ;
287+
288+ debug ! ( "Pid filter for perf file parsing: {pid_filter:?}" ) ;
289+ debug ! ( "Reading perf data from file for mmap extraction" ) ;
286290 let MemmapRecordsOutput {
287291 loaded_modules_by_path,
288292 tracked_pids,
@@ -297,6 +301,12 @@ impl BenchmarkData {
297301 // maps from /tmp to the profile folder. We have to write our own perf
298302 // maps to these files AFTERWARDS, otherwise it'll be overwritten!
299303 debug ! ( "Harvesting perf maps and jit dumps for pids: {tracked_pids:?}" ) ;
304+ harvest_perf_maps_for_pids ( path_ref, & tracked_pids)
305+ . await
306+ . map_err ( |e| {
307+ error ! ( "Failed to harvest perf maps: {e}" ) ;
308+ BenchmarkDataSaveError :: FailedToHarvestPerfMaps
309+ } ) ?;
300310 let jit_unwind_data_by_pid =
301311 jit_dump:: save_symbols_and_harvest_unwind_data_for_pids ( path_ref, & tracked_pids)
302312 . await
0 commit comments