-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot run benches in the main target, examples, or libs #84
Comments
Looking a bit at the PR that added bench support in cargo-instrument and the CLI and API docs for cargo, it seems that So to support this generally, something like cargo instruments -t time --as-bench Or even # Don't run main(), just the #[bench] in the example.
# Maybe if main() does extra stuff for visualization you don't want to measure.
cargo instruments -t time --as-bench --example stress_test And As far as the code, a good start would be to add a flag like As a further improvement to support all benchmarking targets that I'm not sure if |
I second this, I'm trying to run benchmarks on this branch for my project and
Whereas a plain
I would expect traces to be generated for the benchmarks above, but it's not the case right now, although perhaps I'm using the CLI wrong and so perhaps @ariofrio advice on rethinking the benches CLI args makes sense, @cmyr? |
I have a simple project with a benchmark using Rust's built-in
#[bench]
functionality written alongside unit tests, in the same file as the code I'm testing.Usually I run benchmarks using:
Or if I only want to run some functions:
But when I try to run
cargo-instruments
, I get the following error:I don't know what I should put in as the <NAME> since the none of the following work:
I always get the following error:
I get a similar error if I try to specify a name when with
--bench
usingcargo bench
:However I can call
cargo bench
without arguments, or specify--bins
,--bin <name_of_crate>
, or--benches
to run my benchmark without profiling.Any ideas?
The text was updated successfully, but these errors were encountered: