Add an ETW event for reporting richer debug information back (#71263)
authorJakob Botsch Nielsen <Jakob.botsch.nielsen@gmail.com>
Thu, 7 Jul 2022 22:54:04 +0000 (00:54 +0200)
committerGitHub <noreply@github.com>
Thu, 7 Jul 2022 22:54:04 +0000 (00:54 +0200)
commit527f1d1e7a085395ccbf8111066f030627659d10
tree05d3d8a5ee17fb88e07662e9fe0e3f2844893fde
parent641ef68e48fb86a1d1fd156ad1a64a74fee7f629
Add an ETW event for reporting richer debug information back (#71263)

This adds some richer debug information in the form of inline trees and
IL<->native mappings with inlinee information, plus an ETW event in the private
runtime provider to report it back. A COMPlus variable is used to opt-in to
generating and storing this larger debug information.

On the JIT side, we now store a few more fields of data for each inline context
in release builds:

* Its ordinal which is required to be incrementally assigned

* The actual IL offset of the IL instruction leading to the creation of the
  inline context

* The method handle of the inlinee

On the EE side we store the new debug information together with the normal debug
info, reusing the flag byte used for patchpoint information.

The hope is that the new richer format of debug info can eventually replace the
old one, but this won't happen in .NET 7 as I expect it will take some time to
come up with the right format for this data and the right set of fields to
expose. In the meantime this environment variable and event/debugging APIs are
mainly to be used as an opt-in way to start incrementally prototyping on the
tooling side without needing special checked builds of the runtime/JIT.
39 files changed:
src/coreclr/inc/clrconfigvalues.h
src/coreclr/inc/cordebuginfo.h
src/coreclr/inc/corinfo.h
src/coreclr/inc/eventtracebase.h
src/coreclr/inc/icorjitinfoimpl_generated.h
src/coreclr/jit/ICorJitInfo_API_names.h
src/coreclr/jit/ICorJitInfo_API_wrapper.hpp
src/coreclr/jit/codegen.h
src/coreclr/jit/codegencommon.cpp
src/coreclr/jit/codegenlinear.cpp
src/coreclr/jit/compiler.cpp
src/coreclr/jit/compiler.h
src/coreclr/jit/debuginfo.cpp
src/coreclr/jit/debuginfo.h
src/coreclr/jit/ee_il_dll.cpp
src/coreclr/jit/emit.cpp
src/coreclr/jit/fginline.cpp
src/coreclr/jit/importer.cpp
src/coreclr/jit/inline.cpp
src/coreclr/jit/inline.h
src/coreclr/jit/jitconfigvalues.h
src/coreclr/jit/morph.cpp
src/coreclr/tools/Common/JitInterface/CorInfoBase.cs
src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs
src/coreclr/tools/Common/JitInterface/CorInfoTypes.cs
src/coreclr/tools/Common/JitInterface/ThunkGenerator/ThunkInput.txt
src/coreclr/tools/aot/jitinterface/jitinterface.h
src/coreclr/tools/superpmi/superpmi-shim-collector/icorjitinfo.cpp
src/coreclr/tools/superpmi/superpmi-shim-counter/icorjitinfo.cpp
src/coreclr/tools/superpmi/superpmi-shim-simple/icorjitinfo.cpp
src/coreclr/tools/superpmi/superpmi/icorjitinfo.cpp
src/coreclr/vm/ClrEtwAll.man
src/coreclr/vm/codeman.cpp
src/coreclr/vm/codeman.h
src/coreclr/vm/debuginfostore.cpp
src/coreclr/vm/debuginfostore.h
src/coreclr/vm/eventtrace.cpp
src/coreclr/vm/jitinterface.cpp
src/coreclr/vm/jitinterface.h