-
Notifications
You must be signed in to change notification settings - Fork 478
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
Rust support is apparently broken #1450
Comments
Hi @dwlsalmeida, thanks for the report but it looks a duplicate issue with #1392. Could you try again with the following workaround as mentioned at #1392 (comment)?
|
Hi @honggyukim , I think the workaround #1392 still doesn't work with the newest Rust compiler ( |
Thanks for your explanation. It seems there is definitely a problem adding mcount call in Rust compiler. Sorry but it looks like beyond my knowledge for now as it's related Rust and LLVM compilers. I will investigate more when I have enough time for this. As a workaround, I think you can still run uftrace for Rust program with full dynamic tracing. For example, if there is a program $ cat fib.rs
fn fibonacci(n: u32) -> u32 {
match n {
0 => 1,
1 => 1,
_ => fibonacci(n - 1) + fibonacci(n - 2),
}
}
fn main() {
fibonacci(5);
} You can compile it even without
If you run uftrace with the executable binary, uftrace complains that this binary doesn't have
But you can force adding
|
Rust seems to use a newer LLVM with parameterized syntax like in this commit. Please try below:
|
@namhyung thanks for your suggestion, it works for me. |
Rust support is apparently broken, as per rust-lang/rust#96238
It seems like the Rust compiler has stopped inserting the mcount instrumentation at all, which can be verified by something like:
rustc +nightly -Z instrument-mcount hello_world.rs
nm hello_world | grep mcount
Where nothing will show up.
Maybe a warning should be added to the README.md file? I lost a couple hours thinking I failed to properly pass the
-Z instrument-mcount
flag to the Rust compiler.The text was updated successfully, but these errors were encountered: