linux_perf_data/jitdump/
error.rs

1/// The error type used for jitdump parsing.
2#[derive(thiserror::Error, Debug)]
3pub enum JitDumpError {
4    #[error("The file does not contain enough bytes to parse the jitdump header.")]
5    NotEnoughBytesForHeader,
6
7    #[error("Invalid jitdump header size: {0}")]
8    InvalidHeaderSize(u32),
9
10    #[error("The file does not appear to be a jitdump file, due to unexpected magic bytes: {:02x} {:02x} {:02x} {:02x}", .0[0], .0[1], .0[2], .0[3])]
11    InvalidMagicBytes([u8; 4]),
12
13    #[error("The jitdump file has an unrecognized version: {0}")]
14    UnrecognizedVersion(u32),
15
16    #[error("Failed to read from the jitdump file: {0}")]
17    Io(#[from] std::io::Error),
18}