probe::probe! [] [src]

macro_rules! probe {
    ($provider:ident, $name:ident) => { ... };
    ($provider:ident, $name:ident, $($arg:expr),*) => { ... };
}

Define a static probe point.

This annotates a code location with a name and arguments, and compiles in metadata to let debugging tools locate it.

Arguments

Example

#![feature(asm)]
#[macro_use] #[no_link]
extern crate probe;
fn main() {
    probe!(foo, main);

    let x = 42;
    probe!(foo, show_x, x);

    let y = Some(x);
    probe!(foo, show_y, match y {
        Some(n) => n,
        None    => -1
    });
}