proc-tree 0.1.0

Linux process tree: snapshot, incremental maintenance via fork/exec events, ancestry chain queries, PID reuse detection
Documentation
  • Coverage
  • 79.63%
    43 out of 54 items documented18 out of 19 items with examples
  • Size
  • Source code size: 46.53 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 880.14 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 3s Average build duration of successful builds.
  • all releases: 3s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • lenitain/proc-tree
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • lenitain

proc-tree

Crates.io Docs.rs

Linux process tree — snapshot, incremental fork/exec/exit maintenance, ancestry queries, PID reuse detection.

Quick start

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

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

snapshot(&tree, &cache);

let info = resolve(&cache, 1).unwrap();
println!("PID 1: {} ({})", info.cmd, info.user);

let chain = build_chain_string(&tree, &cache, std::process::id());

Module structure

Module Purpose
types PidNode, ProcInfo data types
traits TreeStore, CacheStore trait definitions
ops All algorithms: snapshot, resolve, display, children, etc.
proc Raw /proc reading: parse_proc_entry, read_proc_comm, uid_to_username
tree ProcEvent, ProcessLink types
default_store DefaultStore<V>, DefaultTree, DefaultCache

Custom backend

Implement TreeStore and CacheStore for any storage (Redis, moka, dashmap, ...). See docs.rs for the trait definitions.

License

MIT LICENSE