dd-trace-dotnet icon indicating copy to clipboard operation
dd-trace-dotnet copied to clipboard

Dani/tracer/aot poc

Open daniel-romano-DD opened this issue 1 year ago • 1 comments

Summary of changes

Adds AotProcessor tool to instrument assemblies offline to be used in AoT compilation. To do so, it instantiates the native Profiler and feeds it with the contents of the assembly read by a forked version of Mono.Cecil, then writes the new data into the assembly. In order to host and call native profiler a code generator by @kevingosse has been used (thanks a lot)

Reason for change

AoT requires preinstrumented assemblies in order to generate native images. This must be done in the build pipeline. This tool is intended to be integrated there, reusing all the instrumentation that is already implemented in the native profiler.

Known issues:

CallSite works OOTB, but CallTarget needs runtime emited IL for DuckTyping. So, the pre instrumented assemblies work when executed in a managed runtime, but ducktyping would fail when executed in native, as reflection emit is disabled.

daniel-romano-DD avatar Jun 25 '24 09:06 daniel-romano-DD

Datadog Report

Branch report: dani/tracer/aot_poc Commit report: b30ec21 Test service: dd-trace-dotnet

:white_check_mark: 0 Failed, 52 Passed, 0 Skipped, 34m 6.97s Total Time

datadog-ddstaging[bot] avatar Jun 25 '24 09:06 datadog-ddstaging[bot]