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

coz on Rust programs in release mode (using coz-rs) picks random lines in addr2line and never files in src #197

Open
LoganDark opened this issue Jun 16, 2022 · 4 comments

Comments

@LoganDark
Copy link

I'm trying to use coz and coz-rs to do profiling things to a Rust application but I'm running into issues. The application is being built in release mode with debuginfo.

clion64_7dwaM4Gym2

It keeps picking random lines in addr2line instead of my actual program.

If I specify --source-scope, then all the source files of my program are "included" (according to inspect.cpp:509), but then no experiments are ever conducted. Probably because coz thinks the entire program is just addr2line.

If I build the binary in debug mode, it is prohibitively slow and unoptimized, but experiments get conducted.

In release mode with opt-level 2 experiments are not conducted.

In release mode with opt-level 1 experiments are not conducted.

In release mode with opt-level 0 experiments are conducted.

@bjorn3
Copy link

bjorn3 commented Jun 16, 2022

You need to enable debuginfo I believe. To enable debuginfo in release mode you can add the following to Cargo.toml:

[profile.release]
debug = 1

@LoganDark
Copy link
Author

LoganDark commented Jun 16, 2022

You need to enable debuginfo I believe. To enable debuginfo in release mode you can add the following to Cargo.toml:

[profile.release]
debug = 1

I am using CARGO_PROFILE_RELEASE_DEBUG=true.

The application is being built in release mode with debuginfo

@bjorn3
Copy link

bjorn3 commented Jun 16, 2022

That should be enough to enable debuginfo. I am not familiar with the internals of coz, so I don't think I can help.

@SoftwareApe
Copy link

@bjorn3 can you provide an example program?

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

3 participants