Module linux_perf_data::jitdump
source · 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
- An entry for a single code location (file, line, column). Used inside a
JitCodeDebugInfoRecord
. - A parsed
JIT_CODE_DEBUG_INFO
record, mapping addresses to source lines. - A parsed
JIT_CODE_LOAD
record, for a single jitted function. - A parsed
JIT_CODE_MOVE
record. - A parsed
JIT_CODE_UNWINDING_INFO
record, witheh_frame
data for a single jitted function. - The jitdump header.
- A raw jitdump record whose body hasn’t been parsed yet.
- Parses a jitdump file and allows iterating over records.
- The header which is at the start of every jitdump record.
- The record type of a jitdump record.
Enums
- The error type used for jitdump parsing.
- An enum carrying a parsed jitdump record.