Skip to content

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

Merged
carlossanlop merged 2 commits into
dotnet:release/7.0-rc1from
EgorBo:net70rc1-jitdisasm-impr
Aug 23, 2022
Merged

[release/7.0-rc1] Improve DOTNET_JitDisasm and introduce DOTNET_JitDisasmSummary#74392
carlossanlop merged 2 commits into
dotnet:release/7.0-rc1from
EgorBo:net70rc1-jitdisasm-impr

Conversation

@EgorBo

@EgorBoEgorBo commented Aug 23, 2022

Copy link
Copy Markdown
Member

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

@ghostghost added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Aug 23, 2022
@ghostghost assigned EgorBoAug 23, 2022
@ghost

Copy link
Copy Markdown

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
Copy Markdown
Contributor

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

@jakobbotsch

jakobbotsch commented Aug 23, 2022

Copy link
Copy Markdown
Member

@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
Copy Markdown
MemberAuthor

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
Copy Markdown
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).

@jeffschwMSFTjeffschwMSFT left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
Contributor

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

@carlossanlop
carlossanlop merged commit 516f061 into dotnet:release/7.0-rc1Aug 23, 2022
@ghostghost locked as resolved and limited conversation to collaborators Sep 22, 2022
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-CodeGen-coreclrCLR 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

@EgorBo@omariom@jakobbotsch@jeffschwMSFT@carlossanlop