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

Define Debugger.IsSupported feature switch to allow trimming of debugger only code. #37288

Merged
merged 1 commit into from
Jul 10, 2020

Conversation

eerhardt
Copy link
Member

@eerhardt eerhardt commented Jun 1, 2020

This change introduces a new feature switch that enables code that is only used for debugging to be trimmed by the ILLinker.

So far, there are 2 sets of code that can be trimmed:

  1. Methods and properties being rooted in System.Private.CoreLib's ILLinkTrim.xml file.
  2. Types in System.Linq and Microsoft.CSharp that are required by a debugger.

In the future, once dotnet/linker#1162 is implemented, we should be able to use this same feature switch to remove the DebuggerTypeProxyAttribute when this feature switch is enabled. That will allow us to remove the debugger proxy types as well.

With this feature switch enabled, I'm seeing a ~8KB size change in the CarChecker Blazor WASM app:

Build Size
master 3,423,744 bytes
proposed change 3,415,552 bytes

@ghost
Copy link

ghost commented Jun 1, 2020

Tagging subscribers to this area: @ViktorHofer
Notify danmosemsft if you want to be subscribed.

@eerhardt eerhardt marked this pull request as ready for review July 9, 2020 02:10
@ghost
Copy link

ghost commented Jul 9, 2020

Tagging subscribers to this area: @tommcdon, @krwq
Notify danmosemsft if you want to be subscribed.

@eerhardt eerhardt changed the title Define DebugMode.None feature switch to allow trimming of debugger only code. Define Debugger.IsSupported feature switch to allow trimming of debugger only code. Jul 9, 2020
@eerhardt eerhardt requested a review from sbomer July 9, 2020 02:17
@eerhardt
Copy link
Member Author

eerhardt commented Jul 9, 2020

I believe this is ready for review now, if anyone wants to take a look.

@marek-safar marek-safar merged commit 9814beb into dotnet:master Jul 10, 2020
@eerhardt eerhardt deleted the DebuggingFeatureSwitch branch July 10, 2020 14:31
eerhardt added a commit to eerhardt/sdk that referenced this pull request Jul 14, 2020
…gation

These feature switches were added in the runtime:
* Debugger - dotnet/runtime#37288
* Http activity propagation - dotnet/runtime#38765

Fix dotnet#12217
eerhardt added a commit to dotnet/sdk that referenced this pull request Jul 15, 2020
…gation (#12457)

These feature switches were added in the runtime:
* Debugger - dotnet/runtime#37288
* Http activity propagation - dotnet/runtime#38765

Fix #12217
@ghost ghost locked as resolved and limited conversation to collaborators Dec 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Diagnostics linkable-framework Issues associated with delivering a linker friendly framework
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants