Commit 28a6f89e authored by Tobias Koppers's avatar Tobias Koppers

Add println! logging before all Mmap::map calls to log file path and size

Co-Authored-By: 's avatarClaude <noreply@anthropic.com>
parent 41ed440b
......@@ -391,6 +391,11 @@ fn analyze_sst_file(db_path: &Path, info: &SstInfo) -> Result<SstStats> {
let file = File::open(&path).with_context(|| format!("Failed to open {}", filename))?;
let file_size = file.metadata()?.len();
println!(
"mmap: mapping file {} ({} bytes)",
path.display(),
file_size
);
let mmap = unsafe { Mmap::map(&file)? };
advise_mmap_for_persistence(&mmap)?;
......
......@@ -405,6 +405,12 @@ impl<S: ParallelScheduler, const FAMILIES: usize> TurboPersistence<S, FAMILIES>
let path = self.path.join(format!("{seq:08}.blob"));
let file = File::open(&path)
.with_context(|| format!("Failed to open blob file {}", path.display()))?;
let file_size = file.metadata().map(|m| m.len()).unwrap_or(0);
println!(
"mmap: mapping file {} ({} bytes)",
path.display(),
file_size
);
let mmap = unsafe { Mmap::map(&file) }.with_context(|| {
format!(
"Failed to mmap blob file {} ({} bytes)",
......
......@@ -184,6 +184,12 @@ impl StaticSortedFile {
) -> Result<Self> {
let file = File::open(&path)
.with_context(|| format!("Failed to open SST file {}", path.display()))?;
let file_size = file.metadata().map(|m| m.len()).unwrap_or(0);
println!(
"mmap: mapping file {} ({} bytes)",
path.display(),
file_size
);
let mmap = unsafe { Mmap::map(&file) }.with_context(|| {
format!(
"Failed to mmap SST file {} ({} bytes)",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment