Struct linux_perf_data::jitdump::JitDumpRawRecord
source · pub struct JitDumpRawRecord<'a> {
pub endian: Endianness,
pub record_type: JitDumpRecordType,
pub timestamp: u64,
pub start_offset: u64,
pub record_size: u32,
pub body: RawData<'a>,
}Expand description
A raw jitdump record whose body hasn’t been parsed yet.
Fields§
§endian: EndiannessThe file endian (needs to be known during parsing).
record_type: JitDumpRecordTypeThe record type.
timestamp: u64The timestamp.
start_offset: u64The offset in the jitdump file at which this record is stored. This points to the start of the record header.
record_size: u32The size of this record in bytes, including the record header.
body: RawData<'a>The raw data for the body of this record.
Implementations§
source§impl<'a> JitDumpRawRecord<'a>
impl<'a> JitDumpRawRecord<'a>
sourcepub fn parse(&self) -> Result<JitDumpRecord<'_>, Error>
pub fn parse(&self) -> Result<JitDumpRecord<'_>, Error>
Examples found in repository?
examples/jitdumpdump.rs (line 15)
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
fn main() {
let file = std::fs::File::open(
std::env::args()
.nth(1)
.unwrap_or("/Users/mstange/Downloads/jit-34147.dump".into()),
)
.unwrap();
let mut reader = JitDumpReader::new(file).unwrap();
while let Ok(Some(record)) = reader.next_record() {
let timestamp = record.timestamp;
match record.parse().unwrap() {
JitDumpRecord::CodeLoad(record) => {
println!(
"{timestamp:016} LOAD {} (pid: {}, tid: {})",
record.code_index, record.pid, record.tid
);
println!(
" address: {:#x}, size: {:#x}, name: {}",
record.code_addr,
record.code_bytes.len(),
std::str::from_utf8(&record.function_name.as_slice()).unwrap()
);
println!();
}
JitDumpRecord::CodeMove(record) => {
println!(
"{timestamp:016} MOVE {} (pid: {}, tid: {})",
record.code_index, record.pid, record.tid
);
println!(
" address: {:#x} -> {:#x}, size: {:#x}",
record.old_code_addr, record.new_code_addr, record.code_size
);
println!();
}
JitDumpRecord::CodeDebugInfo(record) => {
println!("{timestamp:016} DEBUG INFO");
println!(" address: {:#x}", record.code_addr);
for entry in &record.entries {
println!(
" {:#8x} {}:{}:{}",
entry.code_addr,
std::str::from_utf8(&entry.file_path.as_slice()).unwrap(),
entry.line,
entry.column
);
}
println!();
}
JitDumpRecord::CodeClose => {
println!("{timestamp:016} CLOSE");
println!();
}
JitDumpRecord::CodeUnwindingInfo(_record) => {
println!("{timestamp:016} UNWINDING INFO");
println!();
}
JitDumpRecord::Other(record) => {
println!("{timestamp:016} <unknown type {}>", record.record_type.0);
println!();
}
}
}
}Trait Implementations§
source§impl<'a> Clone for JitDumpRawRecord<'a>
impl<'a> Clone for JitDumpRawRecord<'a>
source§fn clone(&self) -> JitDumpRawRecord<'a>
fn clone(&self) -> JitDumpRawRecord<'a>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more