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]

pub fn new(pid: u64) -> Result<Self>[src]

Construct a new PageMap for the process with the given PID.

pub fn pid(&self) -> u64[src]

Returns the PID of the process that this PageMap concerns.

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]

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]

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]

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]

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.

Trait Implementations

impl Debug for PageMap[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl RefUnwindSafe for PageMap

impl Send for PageMap

impl Sync for PageMap

impl Unpin for PageMap

impl UnwindSafe for PageMap

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.