
pub fn dump_cpu_record(file_path: impl AsRef<Path>) {
    let f = File::create(file_path).unwrap();
    let mut f = LineWriter::new(f);
    let data = CPU_RECORD.lock().unwrap();
    for line in data.iter() {
        f.write(format!("{:?}\n", line).as_bytes())
            .expect("write file failed");
    }
    f.flush().expect("flush file failed");
}