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

[release/7.0-rc1] Improve DOTNET_JitDisasm and introduce DOTNET_JitDisasmSummary #74392

Merged
merged 2 commits into from
Aug 23, 2022

Conversation

EgorBo
Copy link
Member

@EgorBo EgorBo commented Aug 23, 2022

Backport of #74090 to .NET 7.0 rc1 on @stephentoub's request.

This PR improves UX of a recently added feature to .NET 7.0 - DOTNET_JitDisasm=method (#73365) which gives users ability to print rich assembly code for any function.

Namely, this PR improves wildcard support (e.g. DOTNET_JitDisasm=*foo* or DOTNET_JitDisasm=MyType:*foo*()) and, what is more important, introduces DOTNET_JitDisasmSummary=1 command to print all functions JIT compiles with a short summary (which tier, does it use PGO, etc) - it serves two purposes:

  1. It gives users ability to copy-paste a function name to use in JitDisasm (it's especially important for top-level statements, nested functions and dynamically emitted IL functions -- all those names are machine-generated)
  2. It can be used to quickly validate if PGO works as expected

Example of its output:

  1: JIT compiled SubStringCountTest:Foo():int [Instrumented Tier0, IL size=29, code size=156]
  2: JIT compiled SubStringCountTest:Foo():int [Instrumented Tier1-OSR @0x13 with Dynamic PGO, IL size=29, code size=63]
  3: JIT compiled SubStringCountTest:Foo():int [Tier1 with Dynamic PGO, IL size=29, code size=22]
  4: JIT compiled Thread:Sleep(int) [Tier1 with Static PGO, IL size=33, code size=148]
  ...

(btw, in this specific example SubStringCountTest:Foo is compiled 3 times (3 tiers basically))

Customer Impact

No impact, JitDisasm and JitDisasmSummary are new configuration knobs in .NET7.0

Testing

Tested locally and by SuperPMI jobs

Risk

Low

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Aug 23, 2022
@ghost ghost assigned EgorBo Aug 23, 2022
@ghost
Copy link

ghost commented Aug 23, 2022

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.

Issue Details

Backport of #74090 to .NET 7.0 rc1 on @stephentoub's request.

This PR improves UX of a recently added feature to .NET 7.0 - DOTNET_JitDisasm=method (#73365) which gives users ability to print rich assembly code for any function.

Namely, this PR improves wildcard support (e.g. DOTNET_JitDisasm=*foo* or DOTNET_JitDisasm=MyType:*foo*()) and, what is more important, introduces DOTNET_JitDisasmSummary=1 command to print all functions JIT compiles with a short summary (which tier, does it use PGO, etc) - it serves two purposes:

  1. It gives users ability to copy-paste a function name to use in JitDisasm
  2. It can be used to quickly validate if PGO works as expected

Example of its output:

  1: JIT compiled SubStringCountTest:Foo():int [Instrumented Tier0, IL size=29, code size=156]
  2: JIT compiled SubStringCountTest:Foo():int [Instrumented Tier1-OSR @0x13 with Dynamic PGO, IL size=29, code size=63]
  3: JIT compiled SubStringCountTest:Foo():int [Tier1 with Dynamic PGO, IL size=29, code size=22]
  4: JIT compiled Thread:Sleep(int) [Tier1 with Static PGO, IL size=33, code size=148]
  ...

(btw, in this specific example SubStringCountTest:Foo is compiled 3 times (3 tiers basically))

Customer Impact

No impact, JitDisasm and JitDisasmSummary are new configuration knobs in .NET7.0

Testing

Tested locally and by SuperPMI jobs

Risk

Low

Author: EgorBo
Assignees: -
Labels:

area-CodeGen-coreclr

Milestone: -

@omariom
Copy link
Contributor

omariom commented Aug 23, 2022

It doesn't do any disasm.
May be just DOTNET_JitSummary?

@jakobbotsch
Copy link
Member

jakobbotsch commented Aug 23, 2022

@EgorBo should this get DO-NOT-MERGE label due to #74090 (comment)?
EDIT: Ah sorry, disregard this, I can see you pushed a commit to fix it 🙂

@EgorBo
Copy link
Member Author

EgorBo commented Aug 23, 2022

It doesn't do any disasm. May be just DOTNET_JitSummary?

Good point, I assume it was just for consistency with JitDisasm because it was mainly introduced for that.
but I am open for any better name before we ship it 🙂

@jeffschwMSFT
Copy link
Member

I am double checking, but unless this is unblocking us from shipping RC1, I think we should port this fix to release/7 (for RC2).

Copy link
Member

@jeffschwMSFT jeffschwMSFT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approved for rc1.

@carlossanlop
Copy link
Member

Approved/signed off.
CI passed.
Ready to merge. :shipit:

@carlossanlop carlossanlop merged commit 516f061 into dotnet:release/7.0-rc1 Aug 23, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Sep 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants