Skip to content

Add -Zinstrument-mcount=fentry to -Zinstrument-mcount#158036

Open
pmur wants to merge 1 commit into
rust-lang:mainfrom
pmur:murp/add-fentry
Open

Add -Zinstrument-mcount=fentry to -Zinstrument-mcount#158036
pmur wants to merge 1 commit into
rust-lang:mainfrom
pmur:murp/add-fentry

Conversation

@pmur

@pmur pmur commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

fentry is essentially a simpler version of mcount where the counting function is called before any other function prologue actions happen.

fentry is still used by the linux x86-64 kernel. It's unclear if or when patchable-function-entry will replace it. It is also used by clang for some x86-64 mingw toolchains.

This is only supported on some x86, x86-64, and s390x targets.

fentry is essentially a simpler version of mcount where the
counting function is called before any other function prologue
actions happen.

fentry is still used by the linux x86-64 kernel. It's unclear if
or when patchable-function-entry will replace it. It is also used
by clang for some x86-64 mingw toolchains.

This is only supported on some x86, x86-64, and s390x targets.
@rustbot

rustbot commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator

These commits modify compiler targets.
(See the Target Tier Policy.)

@rustbot rustbot added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jun 17, 2026
@rustbot

rustbot commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator

r? @jackh726

rustbot has assigned @jackh726.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 73 candidates
  • Random selection from 20 candidates

@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

The job aarch64-gnu-llvm-21-2 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
    |
 98 |   macro_rules! assert_ne {
    |   ---------------------- in this expansion of `assert_ne!` (#2)
...
102 |                   if *left_val == *right_val {
    |                      ---------    ^^^^^^^^^^ expected `InstrumentMcount`, found `bool`
    |                      |
    |                      expected because this is `InstrumentMcount`
    |
   ::: compiler/rustc_interface/src/tests.rs:775:5
    |
775 | /     macro_rules! tracked {
776 | |         ($name: ident, $non_default_value: expr) => {
777 | |             opts = reference.clone();
778 | |             assert_ne!(opts.unstable_opts.$name, $non_default_value);
    | |             -------------------------------------------------------- in this macro invocation (#2)
...   |
781 | |         };
782 | |     }
    | |_____- in this expansion of `tracked!` (#1)
...
837 |       tracked!(instrument_mcount, true);
    |       --------------------------------- in this macro invocation (#1)

error[E0308]: mismatched types
   --> compiler/rustc_interface/src/tests.rs:837:33
    |
779 |             opts.unstable_opts.$name = $non_default_value;
    |             ------------------------ expected due to the type of this binding
...
837 |     tracked!(instrument_mcount, true);
    |                                 ^^^^ expected `InstrumentMcount`, found `bool`

For more information about this error, try `rustc --explain E0308`.
[RUSTC-TIMING] rustc_interface test:true 1.599
error: could not compile `rustc_interface` (lib test) due to 2 previous errors
warning: build failed, waiting for other jobs to finish...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants