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
provider- An identifier for naming probe groups.name- An identifier for this specific probe.arg... - Optional data to provide with the probe. Any expression which can be castas i64is allowed as an argument. The arguments might not be evaluated at all when a debugger is not attached to the probe, depending on the platform implementation, so don't rely on side effects.
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 }); }