Struct pagemap::PageMap [−][src]
pub struct PageMap { /* fields omitted */ }
A handle used to read from:
/proc/<PID>/maps
,/proc/<PID>/pagemap
,/proc/kpagecount
, and/proc/kpageflags
for a specific process.
Implementations
impl PageMap
[src]
impl PageMap
[src]pub fn new(pid: u64) -> Result<Self>
[src]
pub fn new(pid: u64) -> Result<Self>
[src]Construct a new PageMap
for the process with the given PID
.
pub fn maps(&mut self) -> Result<Vec<MapsEntry>>
[src]
pub fn maps(&mut self) -> Result<Vec<MapsEntry>>
[src]Returns all virtual memory mappings for the process at hand, as parsed from
/proc/<PID>/maps
.
pub fn pagemap_region(
&mut self,
region: &MemoryRegion
) -> Result<Vec<PageMapEntry>>
[src]
pub fn pagemap_region(
&mut self,
region: &MemoryRegion
) -> Result<Vec<PageMapEntry>>
[src]Returns the entries parsed from reading /proc/<PID>/pagemap
for all pages in the
specified MemoryRegion
of the process at hand.
pub fn pagemap(&mut self) -> Result<Vec<(MapsEntry, Vec<PageMapEntry>)>>
[src]
pub fn pagemap(&mut self) -> Result<Vec<(MapsEntry, Vec<PageMapEntry>)>>
[src]Returns the information about memory mappings, as parsed from reading /proc/<PID>/maps
,
along with a Vec<PageMapEntry>
for each of them, which represent the information read
from /proc/<PID>/pagemap
for each contiguous page in each virtual memory region.
If permitted, every PageMapEntry
is also populated with information read from
/proc/kpagecount
and /proc/kpageflags
.
pub fn kpagecount(&self, pfn: u64) -> Result<u64>
[src]
pub fn kpagecount(&self, pfn: u64) -> Result<u64>
[src]Attempt to read the number of times that the page with the given PFN
is referenced, from
/proc/kpagecount
.
Errors
The method may return PageMapError::Read
or PageMapError::Seek
if either reading
from or seeking into /proc/kpagecount
fails.
Most importantly, the method may return PageMapError::Access
if opening
/proc/kpagecount
was not permitted at the time that the PageMapEntry
was instantiated.
pub fn kpageflags(&self, pfn: u64) -> Result<KPageFlags>
[src]
pub fn kpageflags(&self, pfn: u64) -> Result<KPageFlags>
[src]Attempt to read the flags for the page with the given PFN
from /proc/kpageflags
.
Errors
The method may return PageMapError::Read
or PageMapError::Seek
if either reading
from or seeking into /proc/kpageflags
fails.
Most importantly, the method may return PageMapError::Access
if opening
/proc/kpageflags
was not permitted at the time that the PageMapEntry
was instantiated.