pub struct Mmap<'a> {
pub pid: u32,
pub tid: u32,
pub addr: u64,
pub len: u64,
pub pgoff: u64,
pub filename: Cow<'a, [u8]>,
}
Expand description
MMAP events record memory mappings.
This struct corresponds to PERF_RECORD_MMAP
. See the manpage for more
documentation here.
Fields§
§pid: u32
The process ID.
tid: u32
The thread ID.
addr: u64
The address that the mapping was placed at in the process’ address space.
len: u64
The length, in bytes, of the allocated memory.
pgoff: u64
The page offset of the memory 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> Mmap<'a>
impl<'a> Mmap<'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 into_owned(self) -> Mmap<'static>
pub fn into_owned(self) -> Mmap<'static>
Convert all the borrowed data in this Mmap
into owned data.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Mmap<'a>
impl<'a> RefUnwindSafe for Mmap<'a>
impl<'a> Send for Mmap<'a>
impl<'a> Sync for Mmap<'a>
impl<'a> Unpin for Mmap<'a>
impl<'a> UnwindSafe for Mmap<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more