#parser #binary-parser #xen #trace #analyzer #binary-file #events

xentrace-parser

A XenTrace files parser with a study purpose

4 stable releases

2.1.0 Mar 27, 2024
1.2.0 Aug 2, 2023
1.1.0 Jan 24, 2023
0.10.4 Jul 12, 2022
0.1.4 Jun 6, 2021

#593 in Algorithms

LGPL-2.1-or-later

25KB
546 lines

XenTrace binary data parser (RUST LANG) GitHub Latest Tag Crates.io Downloads

This library parses XenTrace binary files by producing a list of event records sorted by their TSC.

This is the Rust lang version of a project made for the final three-year degree exam at the University of Turin.

Dependencies

  • rust (v1.65+)

Usage

use xentrace_parser::{Result, Trace};

fn main() -> Result<()> {
    // The trace is truncated to the last readable record, returning no errors.
    let trace = Trace::from_file("/path/to/xentrace.bin")?;

    // Alternatively, you can create a trace from a bytes slice:
    // let bytes: Vec<u8> = vec![/* byte data */];
    // let trace = Trace::from_bytes(&bytes)?;

    // Alternatively, you can create a trace from a reader:
    // let file = std::fs::File::open("/path/to/xentrace.bin")?;
    // let bufreader = std::io::BufReader::new(file);
    // let trace = Trace::from_reader(bufreader);

    for record in trace.iter() {
        println!("{:?}", record);
    }

    Ok(())
}

An example debug can be started from the root directory with: cargo run --example debug_trace (only available on GitHub sources).

License

This library is released under the GNU Lesser General Public License v2.1 (or later).

Dependencies

~130KB