Vendor dependencies
Let's see how I like this workflow.
This commit is contained in:
parent
34d1830413
commit
9c435dc440
7500 changed files with 1665121 additions and 99 deletions
17
vendor/procfs/examples/dump.rs
vendored
Normal file
17
vendor/procfs/examples/dump.rs
vendored
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
extern crate procfs;
|
||||
|
||||
fn main() {
|
||||
let pid = std::env::args().nth(1).and_then(|s| s.parse::<i32>().ok());
|
||||
|
||||
let prc = if let Some(pid) = pid {
|
||||
println!("Info for pid={}", pid);
|
||||
procfs::process::Process::new(pid).unwrap()
|
||||
} else {
|
||||
procfs::process::Process::myself().unwrap()
|
||||
};
|
||||
println!("{:#?}", prc);
|
||||
|
||||
let stat = prc.stat().unwrap();
|
||||
println!("State: {:?}", stat.state());
|
||||
println!("RSS: {} bytes", stat.rss_bytes().unwrap());
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue