Also write the total cyc time
This commit is contained in:
parent
c2684b995b
commit
054403ae0d
@ -29,11 +29,12 @@ impl Benchmark for BenchmarkNyx {
|
||||
}
|
||||
|
||||
impl ToCsv for AnalyzeData {
|
||||
const HEADERS: &'static [&'static str] = &["time_main", "time_tsc", "time_qemu"];
|
||||
const HEADERS: &'static [&'static str] = &["time_main_cyc", "time_total_cyc", "time_total_tsc", "time_total_qemu"];
|
||||
|
||||
fn write(&self, writer: &mut Writer<impl Write>) -> csv::Result<()> {
|
||||
writer.write_record([
|
||||
self.time_main.as_secs_f64().to_string(),
|
||||
self.time_cyc.as_secs_f64().to_string(),
|
||||
self.time_tsc.as_secs_f64().to_string(),
|
||||
self.time_qemu.as_secs_f64().to_string(),
|
||||
])
|
||||
|
@ -10,6 +10,7 @@ use crate::benchmark::{Benchmark, ToCsv};
|
||||
use crate::benchmark_baseline::Baseline;
|
||||
use crate::benchmark_nyx_no_pt::BenchmarkNyxNoPt;
|
||||
use crate::benchmark_nyx_pt::BenchmarkNyx;
|
||||
use anyhow::Context;
|
||||
use clap::Parser;
|
||||
use std::fmt::Debug;
|
||||
use std::fs;
|
||||
@ -58,7 +59,7 @@ fn benchmark<B: Benchmark>(
|
||||
) -> anyhow::Result<()> {
|
||||
warmup(&mut benchmark);
|
||||
let results = benchmark_loop(&mut benchmark);
|
||||
write_results::<B>(binary_name, output_dir, &results)?;
|
||||
write_results::<B>(binary_name, output_dir, &results).with_context(|| "Writing results")?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
@ -89,9 +90,11 @@ fn write_results<B: Benchmark>(
|
||||
output_dir: &Path,
|
||||
results: &[B::BenchmarkResult],
|
||||
) -> anyhow::Result<()> {
|
||||
fs::create_dir_all(output_dir)?;
|
||||
fs::create_dir_all(output_dir)
|
||||
.with_context(|| format!("Creating output directory {output_dir:?}"))?;
|
||||
let filename = format!("benchmark_{binary_name}_{}", B::TITLE);
|
||||
let file = fs::File::create(output_dir.join(filename))?;
|
||||
let file =
|
||||
fs::File::create(output_dir.join(filename)).with_context(|| "Creating output file")?;
|
||||
let mut writer = csv::WriterBuilder::new().from_writer(file);
|
||||
writer.write_record(B::BenchmarkResult::HEADERS)?;
|
||||
for result in results {
|
||||
|
Loading…
x
Reference in New Issue
Block a user