-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Crossgen2 perfmap format version support #58468
Comments
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
@tommcdon to triage and assign if this is needed in net 6. |
Tom is out on vacation until August. The perfview changes can happen out of band, we need to know and track any runtime work that happens because we have about a month left. @trylek @hoyosjs @mikem8361 - how much work is necessary to be in the runtime to fully support the scenario? |
I believe we need basically two changes:
Based on these initial assumptions I believe the two changes will first have a chance to combine upon the RC fork in August even though earlier testing should be possible in the SDK repo that receives regular runtime updates. Thanks Tomas |
Thanks Tomas! Do we have the appropriate work items tracking this? Tom is out and I'm generally unaware of this work item. It doesn't sound like any work from the diagnostics team is needed for 6, but will be out of band in perfview. Is that right? |
Well, this was originally intended to be "the work item" tracking the outstanding work but I can easily create two separate ones for the SDK and runtime parts. I can easily make the two fixes in accordance with Tom's suggestion in our related e-mail thread on the issue but it would be great it @hoyosjs and @brianrob could confirm I'm not missing something in the overall plan. I assume that the "work from the diagnostics team" will largely involve setting up the perfmap symbol indexation mechanism but I think it's a completely new feature not necessarily tied to the .NET 6 release. |
The symuploader work needs to happen + pipe it through arcade and then have it flow up if we want to index runtime at build time. Outside of that there's this SDK work and any work needed to have it be consumed (and some pending work in the SFX sdk). |
This PR addresses the remaining work outlined in the issue https://github.com/dotnet/sdk/issues/18813 As of .NET 6 Preview 7 Crossgen2 supports the option --perfmap-format-version that currently supports two values, 0 (being the legacy value / default) and 1; the only difference is that version 1 uses a different naming scheme for the output perfmap files, dropping the {MVID} part and using the extension ".ni.r2rmap". This PR adds support for the new option in the SDK Crossgen2 publishing logic; for .NET 5 and prior, we naturally need to stick to the legacy naming; for .NET 6, SDK honors a new property PublishReadyToRunPerfmapFormatVersion that can be used to override the default. As of the 1st commit on this PR, the SDK default is set to 1 i.e. the "new format". This basically means that from the point of merging this PR onwards SDK will by default produce the new perfmap file names on Linux. Similarly, once SDK preview 7 combines with the runtime repo (which will likely happen as part of the RC1 fork), the installer partition will start producing the new naming style for the Crossgen2-compiled framework. As this is technically a breaking change, we need to discuss whether that's acceptable (e.g. if there was no prior support for perfmap indexation, we probably don't need to care much); if we need tighter control over the perfmap versioning / naming, there are two different things we can do: 1) For now change the PerfmapFormatVersion default to 0 in the SDK Microsoft.NET.CrossGen.targets script. This means that perfmap files will continue to use the legacy naming scheme until someone explicitly switches over runtime or the SDK itself later on in the future. 2) We can make a counterpart check-in to the runtime repo setting PublishReadyToRunPerfmapFormatVersion to 0 in the installer ReadyToRun.targets script; once we're confident to switch over, we'll just delete the property from the scripts. I'm still hitting a couple of errors in local testing but I'm publishing the PR anyway as I'm hoping to solicit early feedback for the change. Thanks Tomas
I have merged in the SDK change adding support for perfmap format version. @hoyosjs / @brianrob, any suggestions regarding the next step? Should we file a new issue to track the symbol upload / indexation logic in arcade? I'm afraid that the remaining work is pretty arcane for me, it would be great if someone more familiar with this logic could pick it up (apart from the fact that I'm OOF for one more week next week). |
You can put it there as there's some work that needs to be done there to the SFX framework too (The globbing needs to be updated). Then runtime and WindowsDesktop use that to crossgen the shared framework I believe. ASP will need to happen separately as they don't use that. Also @trylek, do you know if runtime uses the live crossgen2, or does it use the one in the SDK? Because if so this becomes post-RC1 work. |
Added the details of the missing work items to consume this. Except for the last one, I thing all are needed if we are going to get this for .NET 6. |
@mangod we are transferring this issue to crossgen2 as we discovered there is work left on it. Juan will be updating the checklist with the remaining work |
so this still requires work in 6? |
@hoyosjs assume this can now be closed based on your PR? |
Closing this issue for now. |
As of
#53792
Crossgen2 newly supports a new command-line option
--perfmap-format-version
that currently has two legal values, 0 and 1, where 0 corresponds to the "old style Crossgen1" perfmap naming format and 1 is the "new style Crossgen2" naming format. In particular, historically Crossgen1 used to name perfmap files like this:<assembly-name>.ni.{<MVID of the MSIL file>}.map
This is insufficient and cumbersome in Crossgen2 composite mode where multiple assemblies get compiled into a single native executable; moreover the pre-existing scheme was insufficient anyway as symbol indexation needs to take targeting OS and architecture into consideration and that wasn't reflected in the
MVID
. The new naming in version 1 is like this:<assembly-name>.ni.r2rmap
The current POR is that we drop the
{MVID}
bit and change.map
to.r2rmap
to avoid clashes with traditional .map files; this will need adjusting the following SDK source files:https://github.com/dotnet/sdk/blob/main/src/Tasks/Microsoft.NET.Build.Tasks/ResolveReadyToRunCompilers.cs
https://github.com/dotnet/sdk/blob/main/src/Tasks/Microsoft.NET.Build.Tasks/PrepareForReadyToRunCompilation.cs
https://github.com/dotnet/sdk/blob/main/src/Tasks/Microsoft.NET.Build.Tasks/RunReadyToRunCompiler.cs
We also need to adjust the script calling them:
https://github.com/dotnet/sdk/blob/main/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Publish.targets
These changes should let SDK make Crossgen2 produce the new perfmap format version 1 and ultimately switch over installer build in the runtime repo to produce the new perfmap style files. According to my understanding the bulk of the follow-up work will involve consuming the metadata in the perfmap file for the purpose of symbol indexation; I believe that should be tracked by a separate work item.
This change may need a counterpart perfview change and possibly additional downstream changes I'm not yet aware of; these will probably merit creating additional specific work items as we discover them.
Thanks
Tomas
/cc @dotnet/crossgen-contrib
@dotnet/dotnet-diag
@tommcdon
@brianrob
@hoyosjs
@mikem8361
Work Needed
The text was updated successfully, but these errors were encountered: