pub struct PerfMmapBasedMemoryReader { /* private fields */ }perf_memory_reader only.Expand description
Memory reader that re-construct memory content from perf.data files.
To create a memory reader from perf.data, you should make sure that all binary images involved in the process that be recorded into perf.data are not modified and still in their original paths (perf.data only records the mmap operation for the target process, we use the arguments of mmap to reconstruct the target memory)
You should not use this struct if your perf.data also records kernel
traces, since the kernel memory information would not be recorded in
the perf.data file.
Implementations§
Source§impl PerfMmapBasedMemoryReader
impl PerfMmapBasedMemoryReader
Sourcepub fn new(
mmap2_headers: &[PerfMmap2Header],
) -> Result<Self, PerfMmapBasedMemoryReaderCreateError>
pub fn new( mmap2_headers: &[PerfMmap2Header], ) -> Result<Self, PerfMmapBasedMemoryReaderCreateError>
Create a memory reader from mmap2 headers in perf.data.
Some special mmapped regions (e.g. VDSO pages) will be skipped since we cannot get its content.
Sourcepub fn mmapped_entries(&self) -> &[MmappedEntry]
pub fn mmapped_entries(&self) -> &[MmappedEntry]
Get mmapped entries.
The entries are guaranteed to be sorted by virtual addresses