rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
98.14k stars 12.69k forks source link

Code coverage and profiling don't work on non-X86_64 -musl targets because `profiler_builtins` isn't provided for them #79556

Open briansmith opened 3 years ago

briansmith commented 3 years ago

This indicates to me that it should be practical to enable the profiler feature for -musl targets on ARM and Intel targets, and we should do so. At a minimum, the following very common targets should have the profiler feature enabled:

briansmith commented 3 years ago

Please label this "label:A-code-coverage"

kobehz commented 3 years ago
  • 70054 added profiler_builtins for all Android targets

  • 57257 added support for the profiler builtins for x86_64-unknown-linux-gnu targets.

  • 60476 added the profiler builtins for aarch64-unknown-linux-gnu.

This indicates to me that it should be practical to enable the profiler feature for -musl targets on ARM and Intel targets, and we should do so. At a minimum, the following very common targets should have the profiler feature enabled:

  • [x] x86_64-unknown-linux-musl; done in #57257
  • [ ] aarch64-unknown-linux-musl
  • [ ] arm-unknown-linux-musleabihf
  • [ ] armv7-unknown-linux-musleabihf
  • [ ] i686-unknown-linux-musl

I have the same problem for target aarch64-unknown-linux-musl. What time do you expect to enable the the profiler feature for these targets? Or what can I do myself to solve the problem?

briansmith commented 3 years ago

Or what can I do myself to solve the problem?

I think there's not much stopping us from making a PR to rust-lang/rust that copies https://github.com/rust-lang/rust/pull/76035/files for the other musl targets.

mati865 commented 3 years ago

This might be harder than it sounds since only x86_64 musl target is natively built. Others are cross compiled from Linux GNU target. But trying to do what Brian said won't hurt.

clarfonthey commented 2 years ago

Ran into something similar to this after trying to test some code via cross. If I'm understanding correctly, all tier-2 and below targets don't have support for profiler_builtins. That includes not only the MUSL targets, but targets for architectures other than x86_64, aarch64, and i686.

kobehz commented 2 years ago

你的邮件已收到了,有急事请电话联系。有时间我会给你详细回复.....

tmandry commented 2 years ago

It definitely works for Fuchsia (Tier 2) since we use it there. But we also build our own toolchain. This is probably (at least in part) an issue with the way the official distribution for those targets is configured and built.

briansmith commented 1 year ago

This might be harder than it sounds since only x86_64 musl target is natively built. Others are cross compiled from Linux GNU target.

https://github.com/rust-lang/rust/pull/111575/files added profiler support by just adding --enable-profiler to ENV RUST_CONFIGURE_ARGS. So I think it isn't as hard as we're worried about.

kobehz commented 1 year ago

你的邮件已收到了,有急事请电话联系。有时间我会给你详细回复.....

clarfonthey commented 1 year ago

@kobehz You definitely have your GitHub notifications configured incorrectly. Please make sure that you're not auto-replying to notification emails.