Enhance CrossGen2 to emit PerfMap debug directory entry (#58929)
authorJuan Hoyos <19413848+hoyosjs@users.noreply.github.com>
Fri, 10 Sep 2021 13:40:17 +0000 (06:40 -0700)
committerGitHub <noreply@github.com>
Fri, 10 Sep 2021 13:40:17 +0000 (06:40 -0700)
commit6a7fbec09f3b3f61ecdf6f56fd6e7cc91b651ce8
treec49672b557239d4ca7274d6c69fc4236c60a1804
parent022b73d8a2a268465c28dd3065253bd710ed0a71
Enhance CrossGen2 to emit PerfMap debug directory entry (#58929)

This is used to correlate PE's with their corresponding PerfMaps. For example the header in the perfmap could be:
```
FFFFFFFF 00 026D4D21B3EE3D93843FF7A964235822
FFFFFFFE 00 1
FFFFFFFD 00 1
FFFFFFFC 00 3
FFFFFFFB 00 1
```
And the PE will have the corresponding entries in the PE as:
```
PerfMap (Type 21):
        System.Private.CoreLib.ni.r2rmap, Signature = 026d4d21b3ee3d93843ff7a964235822, Version = 1
```
src/coreclr/tools/aot/ILCompiler.Diagnostics/PerfMapWriter.cs
src/coreclr/tools/aot/ILCompiler.Diagnostics/ReadyToRunDiagnosticsConstants.cs [new file with mode: 0644]
src/coreclr/tools/aot/ILCompiler.ReadyToRun/CodeGen/ReadyToRunObjectWriter.cs
src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/DebugDirectoryEntryNode.cs
src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/DebugDirectoryNode.cs
src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunCodegenCompilation.cs
src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunCodegenCompilationBuilder.cs
src/coreclr/tools/aot/ILCompiler.ReadyToRun/ObjectWriter/SymbolFileBuilder.cs
src/coreclr/tools/r2rdump/R2RDump.cs