Expand description
Parsing code for jitdump files.
jitdump files usually have the name jit-<pid>.dump
. They are associated
with a perf.data
file via an MMAP2
record. This means that the profiled
application which creates these files must also mmap them.
The file contents are binary. The file starts with a file header. The header is followed by a sequence of records. Each record starts with a record header with the record type, a timestamp, and the full size of the record.
§Example
use linux_perf_data::jitdump::{JitDumpReader, JitDumpRecord};
let file = std::fs::File::open("jit-12345.dump")?;
let mut reader = JitDumpReader::new(file)?;
println!("jitdump header: {:?}", reader.header());
while let Some(raw_record) = reader.next_record()? {
let timestamp = raw_record.timestamp;
match raw_record.parse()? {
JitDumpRecord::CodeLoad(record) => {
println!("{timestamp:016} LOAD {record:?}");
}
JitDumpRecord::CodeMove(record) => {
println!("{timestamp:016} MOVE {record:?}");
}
JitDumpRecord::CodeDebugInfo(record) => {
println!("{timestamp:016} DEBUG_INFO {record:?}");
}
JitDumpRecord::CodeClose => {
println!("{timestamp:016} CLOSE");
}
JitDumpRecord::CodeUnwindingInfo(record) => {
println!("{timestamp:016} UNWINDING_Info {record:?}");
}
JitDumpRecord::Other(record) => {
println!("{timestamp:016} {} {record:?}", record.record_type.0);
}
}
}
Structs§
- JitCode
Debug Info Entry - An entry for a single code location (file, line, column). Used inside a
JitCodeDebugInfoRecord
. - JitCode
Debug Info Record - A parsed
JIT_CODE_DEBUG_INFO
record, mapping addresses to source lines. - JitCode
Load Record - A parsed
JIT_CODE_LOAD
record, for a single jitted function. - JitCode
Move Record - A parsed
JIT_CODE_MOVE
record. - JitCode
Unwinding Info Record - A parsed
JIT_CODE_UNWINDING_INFO
record, witheh_frame
data for a single jitted function. - JitDump
Header - The jitdump header.
- JitDump
RawRecord - A raw jitdump record whose body hasn’t been parsed yet.
- JitDump
Reader - Parses a jitdump file and allows iterating over records.
- JitDump
Record Header - The header which is at the start of every jitdump record.
- JitDump
Record Type - The record type of a jitdump record.
Enums§
- JitDump
Error - The error type used for jitdump parsing.
- JitDump
Record - An enum carrying a parsed jitdump record.