Skip to content
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

doesn't understand where bins live #92

Open
NovaDenizen opened this issue Nov 27, 2020 · 0 comments
Open

doesn't understand where bins live #92

NovaDenizen opened this issue Nov 27, 2020 · 0 comments

Comments

@NovaDenizen
Copy link

 $ find src -type f
src/lib.rs
src/bin/prof_bin.rs
 $ cat src/lib.rs

pub fn libfunc() {
    println!("This is a library function");
}
 $ cat src/bin/prof_bin.rs

use cargo_profiler_example::*;

fn main() {
    libfunc();
}
 $ cargo run --bin prof_bin
   Compiling cargo-profiler-example v0.1.0 (/home/novadenizen/prog/cargo-profiler-example)
    Finished dev [unoptimized + debuginfo] target(s) in 0.30s
     Running `target/debug/prof_bin`
This is a library function
 $ cargo profiler cachegrind --bin prof_bin
error: Invalid binary. make sure binary exists.

I did an strace of the cargo profiler command, and found that the current directory is unchanged from the project directory, and it's trying to open the prof_bin binary in the current directory.

I created an empty prof_bin file in the project directory and you can see the error changes.

 $ touch prof_bin
 $ cargo profiler cachegrind --bin prof_bin

Profiling prof_bin with cachegrind...
error: Misaligned data arrays due to regex error -- please file a bug.
 $

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant