Expand description
A crate to provide a simple API to Linux kernel’s pagemap API.
Structs§
- Device
Numbers - Major and minor numbers of a file.
- KPage
Flags - kpageflags as defined in Linux, at
include/uapi/linux/kernel-page-flags.h
. - Maps
Entry - A memory mapping of a process, parsed from
/proc/<PID>/maps
. - Memory
Region - A region of virtual memory, defined by the first and the next-to-last addresses that it includes.
- PageMap
- A handle used to read from:
- Page
MapEntry - An entry read from
/proc/<PID>/pagemap
for a process, and optionally from/proc/kpagecount
and/proc/kpageflags
too. - Page
Permissions - The permissions that a page may have.
Enums§
- Page
MapError - An error type returned by calls to the API exposed by this crate.
Functions§
- maps
- Convenience function for
PageMap::maps
, to parse all entries of/proc/PID/maps
for the process with the givenPID
. - page_
size - Retrieve system’s page size in bytes.
- pagemap
- Convenience wrapper for
PageMap::pagemap
, to retrieve the entries of/proc/PID/maps
for the process with the givenPID
, combined with those in/proc/PID/pagemap
(and also/proc/kpagecount
and/proc/kpageflags
, if permitted). - uss
- Calculate the “unique set size” (USS) (i.e., the amount of memory that a process is using which is not shared with any other process) in bytes.
Type Aliases§
- Result
- A custom
Result
type for this crate, combining a return value with aPageMapError
. It is used all over the crate and also returned by many functions and methods of its external API.