- 
                Notifications
    You must be signed in to change notification settings 
- Fork 5.2k
Description
As of
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:
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
- Consume the changes in R2R map generation.
- SDK needs to consume the flag for new perf format. Add SDK support for perfmap format version sdk#19132
- Runtime needs to also consume them in their copy of the tasks. Emit V1 of perfmap files in ShareFramework packages #57195
- ASP needs to consume this in their own custom CrossGen2 runner. Package r2rmap files in crossgened SFX symbol package aspnetcore#35288
 
- Packaging and indexing.
- Shared framework SDK needs to glob the new map files so they get properly packaged in symbol transport. Support packing new R2R maps to SFX packages arcade#7738
- Symbol indexing needs to be updated to get an update in the spec and in the publishing/download tools.