Struct perf_event_data::Mmap2
source · pub struct Mmap2<'a> {
pub pid: u32,
pub tid: u32,
pub addr: u64,
pub len: u64,
pub pgoff: u64,
pub prot: u32,
pub flags: u32,
pub filename: Cow<'a, [u8]>,
/* private fields */
}Expand description
MMAP2 events record memory mappings with extra info compared to MMAP records.
This struct corresponds to PERF_RECORD_MMAP2. See the manpage for more
documentation here.
Fields§
§pid: u32The process ID.
tid: u32The thread ID.
addr: u64The address that the mapping was placed at in the process’ address space.
len: u64The length, in bytes, of the allocated memory.
pgoff: u64The page offset of the memory mapping.
prot: u32Protection information for the mapping.
flags: u32Flags used when creating the mapping.
filename: Cow<'a, [u8]>The path to the file that is being mapped, if there is one.
Notes
- Not all memory mappings have a path on the file system. In cases where
there is no such path then this will be a label(ish) string from the
kernel (e.g.
[stack],[heap],[vdso], etc.) - Just because the mapping has a path doesn’t necessarily mean that the file at that path was the file that was mapped. The file may have been deleted in the meantime or the process may be under a chroot.
If you need to be able to tell whether the file at the path is the same
one as was mapped you will need to use Mmap2 instead.
Implementations§
source§impl<'a> Mmap2<'a>
impl<'a> Mmap2<'a>
sourcepub fn filename_os(&self) -> &OsStr
pub fn filename_os(&self) -> &OsStr
The path to the file that is being mapped, as an OsStr.
Notes
- Not all memory mappings have a path on the file system. In cases where
there is no such path then this will be a label(ish) string from the
kernel (e.g.
[stack],[heap],[vdso], etc.) - Just because the mapping has a path doesn’t necessarily mean that the file at that path was the file that was mapped. The file may have been deleted in the meantime or the process may be under a chroot.
If you need to be able to tell whether the file at the path is the same
one as was mapped you will need to use Mmap2 instead.
sourcepub fn ino_generation(&self) -> Option<u64>
pub fn ino_generation(&self) -> Option<u64>
The inode generation.
sourcepub fn build_id(&self) -> Option<&[u8]>
pub fn build_id(&self) -> Option<&[u8]>
The build id of the binary being mapped.
This variant will only be generated if build_id was set when building
the counter.
sourcepub fn into_owned(self) -> Mmap2<'static>
pub fn into_owned(self) -> Mmap2<'static>
Convert all the borrowed data in this Mmap2 into owned data.