12 unstable releases (4 breaking)

0.5.1 Apr 11, 2023
0.5.0 Mar 2, 2023
0.4.0 Jan 3, 2023
0.3.0 Jan 14, 2022
0.1.0 Dec 21, 2014

#294 in Visualization

Download history 671/week @ 2024-01-05 874/week @ 2024-01-12 1082/week @ 2024-01-19 1858/week @ 2024-01-26 1834/week @ 2024-02-02 1618/week @ 2024-02-09 2232/week @ 2024-02-16 1492/week @ 2024-02-23 1313/week @ 2024-03-01 1000/week @ 2024-03-08 1338/week @ 2024-03-15 1151/week @ 2024-03-22 1019/week @ 2024-03-29 1491/week @ 2024-04-05 1718/week @ 2024-04-12 1238/week @ 2024-04-19

5,643 downloads per month
Used in 15 crates (8 directly)

Apache-2.0 OR MIT

108 lines

probe: Static probes for Rust

probe crate minimum rustc 1.66 probe documentation build status

With the probe! macro, programmers can place static instrumentation points in their code to mark events of interest. These are compiled into platform-specific implementations, e.g. SystemTap SDT on Linux. Probes are designed to have negligible overhead during normal operation, so they can be present in all builds, and only activated using those external tools.


Using probe

probe! is available on crates.io. The recommended way to use it is to add a line into your Cargo.toml such as:

probe = "0.5"

Then use probe::probe; in your code and insert macro calls wherever you want to mark something, probe!(provider, name, args...). The provider and name are identifiers of your choice, and any additional arguments are runtime expressions that will be cast as isize for the probe consumer to read. There is also a probe_lazy! variant that tries to avoid evaluating the argument expressions when probes aren't in use, if the platform-specific implementation allows that to be determined.


probe is distributed under the terms of both the MIT license and the Apache License (Version 2.0). See LICENSE-APACHE and LICENSE-MIT for details. Opening a pull request is assumed to signal agreement with these licensing terms.

No runtime deps