Raptor trace file in output directory
This commit is contained in:
@@ -3,6 +3,7 @@ use clap::Parser;
|
||||
use glob::glob;
|
||||
use pimcore::cpu::crossbar;
|
||||
use pimcore::json_to_instruction::json_to_executor;
|
||||
use pimcore::tracing::TRACER;
|
||||
use serde_json::Value;
|
||||
use std::{fs, usize};
|
||||
use std::io::Write;
|
||||
@@ -46,6 +47,7 @@ fn main() -> Result<()> {
|
||||
let mut executor = json_to_executor::json_to_executor(config_json, core_jsons.iter());
|
||||
populate_crossbar(&args, &mut executor);
|
||||
set_memory(&mut executor, memory);
|
||||
TRACER.lock().unwrap().init(executor.cpu().num_core(), args.output.clone());
|
||||
executor.execute();
|
||||
dump_memory(executor, &args)?;
|
||||
Ok(())
|
||||
|
||||
@@ -86,7 +86,6 @@ impl Executable {
|
||||
}
|
||||
|
||||
pub fn execute(&mut self) {
|
||||
TRACER.lock().unwrap().init(self);
|
||||
let Self {
|
||||
cpu,
|
||||
core_instructions,
|
||||
|
||||
@@ -3,7 +3,7 @@ mod disable;
|
||||
mod pretty_print;
|
||||
|
||||
#[cfg(feature = "tracing")]
|
||||
use std::fs::File;
|
||||
use std::{fs::File, path::{ PathBuf}};
|
||||
use std::sync::{LazyLock, Mutex};
|
||||
|
||||
use crate::Executable;
|
||||
@@ -21,12 +21,13 @@ impl Trace {
|
||||
}
|
||||
|
||||
|
||||
pub fn init(&mut self, executor : & Executable) {
|
||||
let cpu = executor.cpu();
|
||||
let num_core = cpu.num_core();
|
||||
pub fn init(&mut self, num_core : usize , mut path : PathBuf) {
|
||||
path.pop();
|
||||
for i in 0..num_core {
|
||||
let file = File::create(format!("TraceCore{}", i)).expect("Can not create file");
|
||||
path.push(format!("TraceCore{}", i));
|
||||
let file = File::create(&path).expect("Can not create file");
|
||||
self.out_files.push(file);
|
||||
path.pop();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -43,7 +44,7 @@ impl Trace {
|
||||
}
|
||||
|
||||
|
||||
pub fn init(&mut self, executor : & Executable) {
|
||||
pub fn init(&mut self, num_core : usize, path : PathBuf ) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user