Skip to content

Complete ARM64 support#1449

Merged
tonyredondo merged 27 commits into
masterfrom
tony/arm64-native-adjustments
May 14, 2021
Merged

Complete ARM64 support#1449
tonyredondo merged 27 commits into
masterfrom
tony/arm64-native-adjustments

Conversation

@tonyredondo

@tonyredondo tonyredondo commented May 5, 2021

Copy link
Copy Markdown
Member

This PR includes:

  1. Check if the runtime is .NET 5.0 or greater, can be done by checking if ICorProfilerInfo12 is available.
  2. Enable CallTarget instrumentation by default.
  3. Include ARM64 build into the packages pipeline.
  4. Include ARM64 build into dd-trace dotnet tool and CLI.

Example in Graviton2 instance using dd-trace:

ubuntu@xxx:~/console-test$ ~/.dotnet/tools/dd-trace  dotnet run
Running: dotnet run
Hello World!
ubuntu@xxx:~/console-test$ 

The native logs will be:

05/11/21 09:34:19.470 AM [1908889|1908889] [info] Datadog CLR Profiler 1.26.2 on Linux (arm64)
05/11/21 09:34:19.470 AM [1908889|1908889] [info] .NET 5.0 runtime or greater was detected.
05/11/21 09:34:19.470 AM [1908889|1908889] [info] Environment variables:
05/11/21 09:34:19.470 AM [1908889|1908897] [info] Initializing ReJIT request thread.
05/11/21 09:34:19.484 AM [1908889|1908889] [info] CallTarget instrumentation is enabled.
05/11/21 09:34:19.484 AM [1908889|1908889] [info] JIT Inlining is enabled.
05/11/21 09:34:19.484 AM [1908889|1908889] [info] Profiler attached.
05/11/21 09:34:19.490 AM [1908889|1908889] [info] COR library: System.Private.CoreLib 5.0.0
05/11/21 09:34:19.552 AM [1908889|1908889] [info] JITCompilationStarted: Startup hook registered in function_id=281471402631848 token=100663297 name=console_test.Program.Main(), assembly_name=console-test app_domain_id=187650914680432 domain_neutral=0
05/11/21 09:34:19.566 AM [1908889|1908889] [info] ModuleLoadFinished: Datadog.Trace.ClrProfiler.Managed.Loader loaded into AppDomain 187650914680432 clrhost
05/11/21 09:34:19.762 AM [1908889|1908889] [info] AssemblyLoadFinished: Datadog.Trace.ClrProfiler.Managed v1.26.2 matched profiler version v1.26.2
05/11/21 09:34:20.314 AM [1908889|1908889] [info] Enqueue for ReJIT [ModuleId=281471416426488, MethodDef=0600092f, AppDomainId=187650914680432, IsDomainNeutral=0, Assembly=System.Net.Http, Type=System.Net.Http.SocketsHttpHandler, Method=SendAsync, Signature=2002151280c50112834812833c11809d]
05/11/21 09:34:20.314 AM [1908889|1908889] [info] Enqueue for ReJIT [ModuleId=281471416426488, MethodDef=0600092e, AppDomainId=187650914680432, IsDomainNeutral=0, Assembly=System.Net.Http, Type=System.Net.Http.SocketsHttpHandler, Method=Send, Signature=200212834812833c11809d]
05/11/21 09:34:20.314 AM [1908889|1908889] [info] Enqueue for ReJIT [ModuleId=281471416426488, MethodDef=060003b6, AppDomainId=187650914680432, IsDomainNeutral=0, Assembly=System.Net.Http, Type=System.Net.Http.HttpClientHandler, Method=SendAsync, Signature=2002151280c50112834812833c11809d]
05/11/21 09:34:20.314 AM [1908889|1908889] [info] Enqueue for ReJIT [ModuleId=281471416426488, MethodDef=060003b5, AppDomainId=187650914680432, IsDomainNeutral=0, Assembly=System.Net.Http, Type=System.Net.Http.HttpClientHandler, Method=Send, Signature=200212834812833c11809d]
05/11/21 09:34:20.314 AM [1908889|1908897] [info] Request ReJIT done for 4 methods
05/11/21 09:34:20.531 AM [1908889|1908901] [info] *** CallTarget_RewriterCallback() Finished: System.Net.Http.HttpClientHandler.SendAsync() [IsVoid=0, IsStatic=0, IntegrationType=Datadog.Trace.ClrProfiler.AutoInstrumentation.Http.HttpClient.HttpClientHandler.HttpClientHandlerIntegration, Arguments=2]
05/11/21 09:34:20.534 AM [1908889|1908897] [info] Exiting ReJIT request thread.
05/11/21 09:34:20.534 AM [1908889|1908889] [warning] Exiting. Stats: [Initialize=13ms, ModuleLoadFinished=12ms/40, CallTargetRequestRejit=0ms/12, CallTargetRewriter=0ms/1, AssemblyLoadFinished=0ms/40, ModuleUnloadStarted=0ms/0, JitCompilationStarted=1ms/4288, JitInlining=1ms/9177]

@DataDog/apm-dotnet

@tonyredondo tonyredondo self-assigned this May 5, 2021
@tonyredondo
tonyredondo force-pushed the tony/arm64-native-adjustments branch 3 times, most recently from fc90d95 to 80a2525 Compare May 10, 2021 19:03
@tonyredondo tonyredondo changed the title ARM64 native adjustments ARM64 support adjustments May 11, 2021
@tonyredondo
tonyredondo marked this pull request as ready for review May 11, 2021 09:44
@tonyredondo
tonyredondo requested a review from a team as a code owner May 11, 2021 09:44
@tonyredondo
tonyredondo force-pushed the tony/arm64-native-adjustments branch from 8e4faee to a52a758 Compare May 11, 2021 16:40
@tonyredondo tonyredondo changed the title ARM64 support adjustments Complete ARM64 support May 11, 2021
@tonyredondo tonyredondo added the type:enhancement Improvement to an existing feature label May 11, 2021
Comment thread build/docker/package.arm64.sh Outdated
@tonyredondo
tonyredondo requested review from a team and kevingosse May 12, 2021 10:00
Comment thread src/Datadog.Trace.ClrProfiler.Native/cor_profiler.cpp
Comment thread build/docker/package.arm64.sh Outdated
Comment thread docker-compose.yml
Comment thread src/Datadog.Trace.Tools.Runner/Utils.cs Outdated
Comment thread .azure-pipelines/runner.yml
@tonyredondo
tonyredondo requested review from a team, andrewlock and zacharycmontoya May 13, 2021 10:39
Comment thread build/docker/package.sh
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
VERSION=1.26.3
BUILD_TYPE=${buildConfiguration:-Debug}
ARCH=${ARCHITECTURE:-x64}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just an FYI, you can also set this default in the docker-compose file if it's preferable (not saying it is, just an FYI, as I've had to do similar in the Nuke branch) 🙂

Comment thread build/docker/package.sh Outdated
Comment thread build/docker/package.sh
Comment thread src/Datadog.Trace.ClrProfiler.Native/environment_variables_util.h
Comment thread src/Datadog.Trace.Tools.Runner/Utils.cs Outdated
Comment thread src/Datadog.Trace.Tools.Runner/Utils.cs Outdated
@tonyredondo
tonyredondo force-pushed the tony/arm64-native-adjustments branch from 1f2349a to c4f18d4 Compare May 14, 2021 08:21
@tonyredondo
tonyredondo dismissed kevingosse’s stale review May 14, 2021 09:14

The request was addressed by removing the file and using the existing one. As @zacharymontoya

@tonyredondo
tonyredondo merged commit 5ba7611 into master May 14, 2021
@tonyredondo
tonyredondo deleted the tony/arm64-native-adjustments branch May 14, 2021 09:16
@DerrickMartinez

Copy link
Copy Markdown

When is a release of this expected to be out?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-docs-update type:enhancement Improvement to an existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants