Skip to content

Commit

Permalink
simulator: Replace println() calls with log::info()
Browse files Browse the repository at this point in the history
  • Loading branch information
penberg committed Jan 14, 2025
1 parent 9db5061 commit a9ffa72
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
14 changes: 7 additions & 7 deletions simulator/runner/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,29 +29,29 @@ impl SimulatorFile {
}

pub(crate) fn print_stats(&self) {
println!("op calls faults");
println!("--------- -------- --------");
println!(
log::info!("op calls faults");
log::info!("--------- -------- --------");
log::info!(
"pread {:8} {:8}",
*self.nr_pread_calls.borrow(),
*self.nr_pread_faults.borrow()
);
println!(
log::info!(
"pwrite {:8} {:8}",
*self.nr_pwrite_calls.borrow(),
*self.nr_pwrite_faults.borrow()
);
println!(
log::info!(
"sync {:8} {:8}",
*self.nr_sync_calls.borrow(),
0 // No fault counter for sync
);
println!("--------- -------- --------");
log::info!("--------- -------- --------");
let sum_calls = *self.nr_pread_calls.borrow()
+ *self.nr_pwrite_calls.borrow()
+ *self.nr_sync_calls.borrow();
let sum_faults = *self.nr_pread_faults.borrow() + *self.nr_pwrite_faults.borrow();
println!("total {:8} {:8}", sum_calls, sum_faults);
log::info!("total {:8} {:8}", sum_calls, sum_faults);
}
}

Expand Down
7 changes: 3 additions & 4 deletions simulator/runner/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,11 @@ impl SimulatorIO {
}

pub(crate) fn print_stats(&self) {
println!("run_once faults: {}", self.nr_run_once_faults.borrow());
log::info!("run_once faults: {}", self.nr_run_once_faults.borrow());
for file in self.files.borrow().iter() {
println!();
println!("===========================");
log::info!("");
log::info!("===========================");
file.print_stats();
println!();
}
}
}
Expand Down

0 comments on commit a9ffa72

Please sign in to comment.