Crates.io | numa_maps |
lib.rs | numa_maps |
version | 0.1.0 |
source | src |
created_at | 2024-02-25 03:59:00.96528 |
updated_at | 2024-02-25 04:38:53.649237 |
description | Parse the numa_maps file |
homepage | |
repository | https://github.com/antiguru/numa_maps |
max_upload_size | |
id | 1152160 |
size | 32,666 |
A simple library to read the numa_maps
file on Linux.
[dependencies]
numa_maps = "0.1"
#[cfg(target_os = "linux")]
let map = numa_maps::NumaMap::from_file("/proc/self/numa_maps").unwrap();
#[cfg(not(target_os = "linux"))]
let map = numa_maps::NumaMap::default();
for region in &map.ranges {
println!("base: {:x} -> {:?}", region.address, region.properties);
}
numa_maps
provides a simple API to read the contents of the numa_maps
file.
It parses the file into ranges with a base address, a policy, and a list of
properties.