Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions crates/runner-shared/src/unwind_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use core::{
hash::{Hash, Hasher},
};
use serde::{Deserialize, Serialize};
use std::io::BufWriter;
use std::{hash::DefaultHasher, ops::Range};

pub const UNWIND_FILE_EXT: &str = "unwind_data";
Expand Down Expand Up @@ -41,9 +42,13 @@ impl UnwindData {
log::warn!("{} {:x?}", self.path, self.avma_range);
}

let mut writer = std::fs::File::create(path.as_ref())?;
let compat = UnwindDataCompat::V2(self.clone());
bincode::serialize_into(&mut writer, &compat)?;
let file = std::fs::File::create(path.as_ref())?;
const BUFFER_SIZE: usize = 256 * 1024 /* 256 KB */;

let writer = BufWriter::with_capacity(BUFFER_SIZE, file);
bincode::serialize_into(writer, &compat)?;

Ok(())
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/executor/shared/fifo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ impl RunnerFifo {
break;
}

let result = tokio::time::timeout(Duration::from_secs(5), self.recv_cmd()).await;
let result = tokio::time::timeout(Duration::from_secs(1), self.recv_cmd()).await;
let cmd = match result {
Ok(Ok(cmd)) => cmd,
Ok(Err(e)) => {
Expand Down
2 changes: 1 addition & 1 deletion src/executor/wall_time/perf/debug_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ impl ProcessDebugInfo {
modules.push(module_debug_info);
}
Err(error) => {
debug!("Failed to load debug info for module {path:?}: {error}");
trace!("Failed to load debug info for module {path:?}: {error}");
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/executor/wall_time/perf/parse_perf_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ pub(super) fn parse_for_memmap2<P: AsRef<Path>>(perf_file_path: P) -> Result<Mem
continue;
}

debug!(
trace!(
"Pid {}: {:016x}-{:016x} {:08x} {:?} (Prot {:?})",
record.pid,
record.address,
Expand All @@ -106,7 +106,7 @@ pub(super) fn parse_for_memmap2<P: AsRef<Path>>(perf_file_path: P) -> Result<Mem
end_addr,
record.page_offset,
);
debug!("Added symbols mapping for module {record_path_string:?}");
trace!("Added symbols mapping for module {record_path_string:?}");

match UnwindData::new(
record_path_string.as_bytes(),
Expand All @@ -120,7 +120,7 @@ pub(super) fn parse_for_memmap2<P: AsRef<Path>>(perf_file_path: P) -> Result<Mem
.entry(record.pid)
.or_default()
.push(unwind_data);
debug!(
trace!(
"Added unwind data for {record_path_string} ({:x} - {:x})",
record.address, end_addr
);
Expand Down
8 changes: 5 additions & 3 deletions src/executor/wall_time/perf/perf_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use object::{Object, ObjectSymbol, ObjectSymbolTable};
use std::{
collections::HashMap,
fmt::Debug,
io::Write,
io::{BufWriter, Write},
path::{Path, PathBuf},
};

Expand Down Expand Up @@ -139,14 +139,16 @@ impl ModuleSymbols {
}

pub fn append_to_file<P: AsRef<Path>>(&self, path: P) -> anyhow::Result<()> {
let mut file = std::fs::OpenOptions::new()
let file = std::fs::OpenOptions::new()
.create(true)
.append(true)
.open(path)?;
const BUFFER_SIZE: usize = 256 * 1024 /* 256 KB */;

let mut writer = BufWriter::with_capacity(BUFFER_SIZE, file);
for symbol in &self.symbols {
writeln!(
file,
writer,
"{:x} {:x} {}",
symbol.addr.wrapping_add(self.load_bias),
symbol.size,
Expand Down
Loading