2 releases

new 0.1.1 Dec 23, 2024
0.1.0 Dec 23, 2024

#3 in #printf

Download history 218/week @ 2024-12-21

218 downloads per month
Used in pmortem

Apache-2.0 OR MIT

665KB
21K SLoC

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();

Dependencies

~255–750KB
~18K SLoC