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