Implement RFC 3917 for instrumented functions#153742
Draft
pmur wants to merge 7 commits intorust-lang:mainfrom
Draft
Implement RFC 3917 for instrumented functions#153742pmur wants to merge 7 commits intorust-lang:mainfrom
pmur wants to merge 7 commits intorust-lang:mainfrom
Conversation
This comment has been minimized.
This comment has been minimized.
48 tasks
This attribute enables or disables function instrumentation when using `-Zinstrument-xray` or `-Zinstrument-mcount`. It supports the following usage: `#[instrument_fn = "on|off"]` For XRay, "on" is equivalent to always instrument, and "off" is equivalent to never instrumenting. For mcount, "on" has no effect. "off" disables instrumentation of the function.
The behavior is very similar to `-Zinstrument-mcount`, except this option has no frame-pointer requirements, and is called before the call frame is set up. This only works on x86, x86-64, and s390x targets.
This facilitates support for inserting nop's and/or recording the location of each mcount call in a special section named `__mcount_loc`.
1d0e673 to
c12fc8d
Compare
This comment has been minimized.
This comment has been minimized.
Convert these into `-Zinstrument-function={none|fentry|xray}`.
`-Zinstrument-xray` is split into `-Zinstrument-function=xray` and
`-Zinstrument-xray-opts=...`.
Also, rename `-Zinstrument-mcount-opts` to `-Zinstrument-fentry-opts` to
reflect it is only usable with fentry. In theory, it could work with
both (as it does on gcc), in practice the llvm support is limited to
s390x/fentry as of llvm 22.
This is maybe gated by some sort of agreement on RFC 3917?
c12fc8d to
d89e115
Compare
This comment has been minimized.
This comment has been minimized.
Contributor
|
☔ The latest upstream changes (presumably #154466) made this pull request unmergeable. Please resolve the merge conflicts. |
Contributor
|
☔ The latest upstream changes (presumably #154503) made this pull request unmergeable. Please resolve the merge conflicts. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds:
-Zinstrument-function={mcount,fentry,xray,none}option-Zinstrument-fentry-opts=.... This is probably only needed for linux.-Zinstrument-xrayis renamed to-Zinstrument-xray-optsand the yes/no/implicit option are removed.#[instrument_fn="on|off"]attribute for toggling instrumentation on select functions.