On Windows, when coreclr loads R2R-built jit assemblies are loaded, symbols from them can be resolved using PDB files and everything works fine. On macOS (and probably linux, since they share the same code), PreJIT symbols are emitted into jitdump files with PerfMapEnabled=1 (but not perfmap files, which is also odd).
Using eventpipe, MethodLoad[Verbose] events are not emitted for for R2R symbols. This is a little annoying, but it matches Windows behaviour. However, there are R2RGetEntryPoint events that are emitted with the compiler diagnostics keyword. These events have almost all the info I need... except the method native code size. As-is, the data in these events gives roughly the same info as a basic symbol map. For every R2RGetEntryPoint, I could look up what native library is mapped at that address and add it to my in-memory symbol map, and then on library unload/process end take all the symbols and infer sizes based on next symbol/end-of-mapping. This is kind of a pain.
I believe the size is available using the same approach that PerfMap::LogPreCompiledMethod uses:
// Get information about the NGEN'd method code.
EECodeInfo codeInfo(pCode);
_ASSERTE(codeInfo.IsValid());
IJitManager::MethodRegionInfo methodRegionInfo;
codeInfo.GetMethodRegionInfo(&methodRegionInfo);
if this is true, are people open to a V1 of the R2RGetEntryPoint event that adds a code size? This would mean that the V0 event would no longer be emitted, so PerfView and others may be impacted, though I'm not sure if they're doing anything specific with this event.
R2RGetEntryPoint also doesn't include info about separate hot/cold precompiled code (there's only one method start address, so I assume only the hot address gets reported). Maybe a better approach would be adding a new event, R2RMethodLoad, that looks something like...
<data name="MethodID" inType="win:UInt64" outType="win:HexInt64" />
<data name="MethodNamespace" inType="win:UnicodeString" />
<data name="MethodName" inType="win:UnicodeString" />
<data name="MethodSignature" inType="win:UnicodeString" />
<data name="MethodStartAddress" inType="win:Pointer" />
<data name="MethodSize" inType="win:UInt32" />
<data name="MethodColdStartAddress" inType="win:Pointer" />
<data name="MethodColdSize" inType="win:UInt32" />
<data name="ClrInstanceID" inType="win:UInt16" />
On Windows, when coreclr loads R2R-built jit assemblies are loaded, symbols from them can be resolved using PDB files and everything works fine. On macOS (and probably linux, since they share the same code),
PreJITsymbols are emitted intojitdumpfiles withPerfMapEnabled=1(but notperfmapfiles, which is also odd).Using eventpipe,
MethodLoad[Verbose]events are not emitted for for R2R symbols. This is a little annoying, but it matches Windows behaviour. However, there areR2RGetEntryPointevents that are emitted with the compiler diagnostics keyword. These events have almost all the info I need... except the method native code size. As-is, the data in these events gives roughly the same info as a basic symbol map. For everyR2RGetEntryPoint, I could look up what native library is mapped at that address and add it to my in-memory symbol map, and then on library unload/process end take all the symbols and infer sizes based on next symbol/end-of-mapping. This is kind of a pain.I believe the size is available using the same approach that
PerfMap::LogPreCompiledMethoduses:if this is true, are people open to a V1 of the
R2RGetEntryPointevent that adds a code size? This would mean that the V0 event would no longer be emitted, so PerfView and others may be impacted, though I'm not sure if they're doing anything specific with this event.R2RGetEntryPoint also doesn't include info about separate hot/cold precompiled code (there's only one method start address, so I assume only the hot address gets reported). Maybe a better approach would be adding a new event,
R2RMethodLoad, that looks something like...