macro_rules! debug_benchmarks {
() => { ... };
}Available on crate feature
full only.Expand description
Generates a debug function that prints all discovered benchmarks.
This macro is useful for debugging benchmark registration issues.
It creates a function _debug_print_benchmarks() that you can call
to see which benchmarks have been registered via #[benchmark].
§Example
ⓘ
use mobench_sdk::{benchmark, debug_benchmarks};
#[benchmark]
fn my_benchmark() {
std::hint::black_box(42);
}
// Generate the debug function
debug_benchmarks!();
fn main() {
// Print all registered benchmarks
_debug_print_benchmarks();
// Output:
// Discovered benchmarks:
// - my_crate::my_benchmark
}§Troubleshooting
If no benchmarks are printed:
- Ensure functions are annotated with
#[benchmark] - Ensure functions are
pub(public visibility) - Ensure the crate with benchmarks is linked into the binary
- Check that
inventorycrate is in your dependencies