Skip to main content

resolve

Function resolve 

Source
pub fn resolve(cache: &impl CacheStore, pid: u32) -> Option<ProcInfo>
Expand description

Resolve a PID to its process info.

Checks the cache first, then falls back to reading /proc directly.

use proc_tree::{DefaultTree, DefaultCache, snapshot, resolve, TreeStore};

let tree = DefaultTree::new(65536, 600);
let cache = DefaultCache::new(65536, 600);
snapshot(&tree, &cache);

let info = resolve(&cache, 1).unwrap();
assert!(!info.cmd.is_empty());