Skip to content

xiaopengli89/dtrace-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dtrace

Rust-like bindings to dtrace.

let pid = 1324;
let mut dt = dtrace::Dtrace::new().unwrap();
dt.setopt_c(c"strsize", c"4096").unwrap();
dt.setopt_c(c"bufsize", c"4m").unwrap();
dt.exec_program(&format!(
    r#"pid{}::__exit:entry{{printf("exit"); exit(0)}}"#,
    pid
))
.unwrap();
dt.go().unwrap();

println!("waiting for exit...");
while let Ok(false) = dt.work(|output| {
    println!(">> {output}");
}) {}
dt.stop().unwrap();

About

Rust-like bindings to dtrace.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages