Raptor trace file in output directory

This commit is contained in:
ilgeco
2026-02-25 13:36:53 +01:00
parent 4c67335274
commit 3d5f2d8f81
3 changed files with 9 additions and 7 deletions

View File

@@ -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(())

View File

@@ -86,7 +86,6 @@ impl Executable {
}
pub fn execute(&mut self) {
TRACER.lock().unwrap().init(self);
let Self {
cpu,
core_instructions,

View File

@@ -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 ) {
}
}