[POC] Naming cleanup (#203)
* fix gitignore * refactor project namings * refactor native project dir name * fix sample * clean sln file * fix make definititons * remove unnecessary constants
This commit is contained in:
parent
e67f865795
commit
4e2fd9ebc9
|
@ -277,9 +277,6 @@ deploy/AzureAppServices/
|
|||
# macOS temporal files
|
||||
.DS_Store
|
||||
|
||||
# profiler output files
|
||||
src/Datadog.Trace.ClrProfiler.Native/build/
|
||||
|
||||
# ignore blog folder from upstream
|
||||
blog/
|
||||
|
||||
|
@ -287,4 +284,13 @@ blog/
|
|||
.nuke/*
|
||||
|
||||
# exception to the ignore rule
|
||||
!/**/.gitkeep
|
||||
!/**/.gitkeep
|
||||
|
||||
# profiler build files
|
||||
src/OpenTelemetry.AutoInstrumentation.ClrProfiler.Native/build/
|
||||
src/OpenTelemetry.AutoInstrumentation.ClrProfiler.Native/deps/
|
||||
src/OpenTelemetry.AutoInstrumentation.ClrProfiler.Native/CMakeFiles/
|
||||
src/OpenTelemetry.AutoInstrumentation.ClrProfiler.Native/tmp.*
|
||||
src/OpenTelemetry.AutoInstrumentation.ClrProfiler.Native/Makefile
|
||||
src/OpenTelemetry.AutoInstrumentation.ClrProfiler.Native/CMakeCache.txt
|
||||
src/OpenTelemetry.AutoInstrumentation.ClrProfiler.Native/cmake_install.cmake
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
"razor.disabled": true,
|
||||
"omnisharp.defaultLaunchSolution": "Datadog.Trace.Minimal.sln"
|
||||
"omnisharp.defaultLaunchSolution": "OpenTelemetry.AutoInstrumentation.sln"
|
||||
}
|
||||
|
|
|
@ -1,181 +0,0 @@
|
|||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<BuildInParallel Condition="'$(BuildInParallel)' == ''">true</BuildInParallel>
|
||||
<Configuration Condition="'$(Configuration)' == ''">Debug</Configuration>
|
||||
<TracerHomeDirectory Condition="'$(TracerHomeDirectory)' == ''">$(MSBuildThisFileDirectory)src\bin\windows-tracer-home</TracerHomeDirectory>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<CsharpProject Include="src\**\*.csproj" />
|
||||
<CppProject Include="src\**\*.vcxproj"/>
|
||||
<CppTestProject Include="test\**\*.vcxproj"/>
|
||||
<SampleProject Include="test\test-applications\**\*.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="Restore">
|
||||
<MSBuild Targets="Restore" Projects="@(CsharpProject);@(CppProject);@(SampleProject)"/>
|
||||
</Target>
|
||||
|
||||
<Target Name="Clean">
|
||||
<MSBuild Targets="Clean" Projects="@(CsharpProject);@(CppProject);@(SampleProject)"/>
|
||||
</Target>
|
||||
|
||||
<!-- default target -->
|
||||
<Target Name="Build">
|
||||
<MSBuild Targets="Build" Projects="@(CsharpProject);@(CppProject)">
|
||||
<Output TaskParameter="TargetOutputs" ItemName="CollectedBuildOutput"/>
|
||||
</MSBuild>
|
||||
</Target>
|
||||
|
||||
<Target Name="BuildFrameworkReproductions">
|
||||
<MSBuild Targets="Build" Projects="@(FrameworkReproduction)">
|
||||
<Output TaskParameter="TargetOutputs" ItemName="CollectedBuildOutput"/>
|
||||
</MSBuild>
|
||||
</Target>
|
||||
|
||||
<Target Name="BuildCsharp">
|
||||
<MSBuild Targets="Restore" Projects="@(CsharpProject)" Properties="Platform=AnyCPU">
|
||||
<Output TaskParameter="TargetOutputs" ItemName="CollectedBuildOutput"/>
|
||||
</MSBuild>
|
||||
|
||||
<MSBuild Targets="Build" Projects="@(CsharpProject)" Properties="Platform=AnyCPU">
|
||||
<Output TaskParameter="TargetOutputs" ItemName="CollectedBuildOutput"/>
|
||||
</MSBuild>
|
||||
</Target>
|
||||
|
||||
<Target Name="BuildCpp">
|
||||
<MSBuild Targets="Build" Projects="@(CppProject)" Condition="'$(Platform)' == 'x64' OR '$(Platform)' == 'All'" Properties="Platform=x64">
|
||||
<Output TaskParameter="TargetOutputs" ItemName="CollectedBuildOutput"/>
|
||||
</MSBuild>
|
||||
|
||||
<MSBuild Targets="Build" Projects="@(CppProject)" Condition="'$(Platform)' == 'x86' OR '$(Platform)' == 'All' OR '$(Buildx86Profiler)' == 'true'" Properties="Platform=x86">
|
||||
<Output TaskParameter="TargetOutputs" ItemName="CollectedBuildOutput"/>
|
||||
</MSBuild>
|
||||
</Target>
|
||||
|
||||
<Target Name="BuildCppTests">
|
||||
<MSBuild Targets="Build" Projects="@(CppTestProject)">
|
||||
<Output TaskParameter="TargetOutputs" ItemName="CollectedBuildOutput"/>
|
||||
</MSBuild>
|
||||
</Target>
|
||||
|
||||
<Target Name="RestoreAndBuildSamplesForPackageVersions" Condition="'$(TestAllPackageVersions)'=='true'">
|
||||
|
||||
<!-- Build the core C# projects first, so that the sample project builds do not need to build them and can be run
|
||||
concurrently -->
|
||||
<MSBuild Targets="Restore" Projects="@(CsharpProject)" BuildInParallel="false" RemoveProperties="TargetFramework;Platform">
|
||||
<Output TaskParameter="TargetOutputs" ItemName="CollectedBuildOutput"/>
|
||||
</MSBuild>
|
||||
<MSBuild Targets="Build" Projects="@(CsharpProject)" BuildInParallel="false" RemoveProperties="TargetFramework;Platform">
|
||||
<Output TaskParameter="TargetOutputs" ItemName="CollectedBuildOutput"/>
|
||||
</MSBuild>
|
||||
|
||||
<!-- Filter the sample projects by TargetFramework -->
|
||||
<ItemGroup>
|
||||
<PackageVersionSampleCompile Include="@(PackageVersionSample)" Condition="'%(PackageVersionSample.TargetFramework)' == '' or '%(PackageVersionSample.TargetFramework)'=='$(TargetFramework)'" />
|
||||
</ItemGroup>
|
||||
|
||||
<!-- Build the sample projects concurrently -->
|
||||
<MSBuild Targets="Restore" Projects="@(PackageVersionSampleCompile)" BuildInParallel="$(BuildInParallel)">
|
||||
<Output TaskParameter="TargetOutputs" ItemName="CollectedBuildOutput"/>
|
||||
</MSBuild>
|
||||
<MSBuild Targets="Publish" Projects="@(PackageVersionSampleCompile)" BuildInParallel="$(BuildInParallel)">
|
||||
<Output TaskParameter="TargetOutputs" ItemName="CollectedBuildOutput"/>
|
||||
</MSBuild>
|
||||
</Target>
|
||||
|
||||
<Target Name="BuildSamples" DependsOnTargets="RestoreAndBuildSamplesForPackageVersions">
|
||||
<MSBuild Targets="Build" Projects="@(SampleProject)">
|
||||
<Output TaskParameter="TargetOutputs" ItemName="CollectedBuildOutput"/>
|
||||
</MSBuild>
|
||||
</Target>
|
||||
|
||||
<Target Name="PublishManagedProfilerOnDisk">
|
||||
<ItemGroup>
|
||||
<TargetFramework Include="net45;net461;netstandard2.0;netcoreapp3.1" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ManagedProfilerPublishProject Include="src\Datadog.Trace.ClrProfiler.Managed\Datadog.Trace.ClrProfiler.Managed.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<MSBuild Targets="Publish" Projects="@(ManagedProfilerPublishProject)" BuildInParallel="false" Properties="Platform=AnyCPU;TargetFramework=%(TargetFramework.Identity);PublishDir=$(TracerHomeDirectory)\%(TargetFramework.Identity)">
|
||||
<Output TaskParameter="TargetOutputs" ItemName="CollectedBuildOutput"/>
|
||||
</MSBuild>
|
||||
</Target>
|
||||
|
||||
<Target Name="PublishBuildLoggerOnDisk">
|
||||
<ItemGroup>
|
||||
<BuildLoggerPublishProject Include="src\Datadog.Trace.MSBuild\Datadog.Trace.MSBuild.csproj">
|
||||
<Properties>Platform=AnyCPU;TargetFramework=net45;PublishDir=$(TracerHomeDirectory)\net45</Properties>
|
||||
</BuildLoggerPublishProject>
|
||||
|
||||
<BuildLoggerPublishProject Include="src\Datadog.Trace.MSBuild\Datadog.Trace.MSBuild.csproj">
|
||||
<Properties>Platform=AnyCPU;TargetFramework=net461;PublishDir=$(TracerHomeDirectory)\net461</Properties>
|
||||
</BuildLoggerPublishProject>
|
||||
|
||||
<BuildLoggerPublishProject Include="src\Datadog.Trace.MSBuild\Datadog.Trace.MSBuild.csproj">
|
||||
<Properties>Platform=AnyCPU;TargetFramework=netstandard2.0;PublishDir=$(TracerHomeDirectory)\netstandard2.0</Properties>
|
||||
</BuildLoggerPublishProject>
|
||||
|
||||
<BuildLoggerPublishProject Include="src\Datadog.Trace.MSBuild\Datadog.Trace.MSBuild.csproj">
|
||||
<Properties>Platform=AnyCPU;TargetFramework=netcoreapp3.1;PublishDir=$(TracerHomeDirectory)\netcoreapp3.1</Properties>
|
||||
</BuildLoggerPublishProject>
|
||||
</ItemGroup>
|
||||
|
||||
<MSBuild Targets="Publish" Projects="@(BuildLoggerPublishProject)" BuildInParallel="false">
|
||||
<Output TaskParameter="TargetOutputs" ItemName="CollectedBuildOutput"/>
|
||||
</MSBuild>
|
||||
</Target>
|
||||
|
||||
<Target Name="BuildLoader">
|
||||
<ItemGroup>
|
||||
<ManagedLoaderProject Include="src\Datadog.Trace.ClrProfiler.Managed.Loader\Datadog.Trace.ClrProfiler.Managed.Loader.csproj"/>
|
||||
</ItemGroup>
|
||||
|
||||
<MSBuild Targets="Build" Projects="@(ManagedLoaderProject)" Properties="Platform=AnyCPU">
|
||||
<Output TaskParameter="TargetOutputs" ItemName="CollectedBuildOutput"/>
|
||||
</MSBuild>
|
||||
</Target>
|
||||
|
||||
<Target Name="PublishNativeProfilerOnDisk" DependsOnTargets="BuildLoader;BuildCpp">
|
||||
<Copy Condition="'$(Platform)' == 'x64' OR '$(Platform)' == 'All'"
|
||||
SourceFiles="$(MSBuildThisFileDirectory)src\Datadog.Trace.ClrProfiler.Native\bin\$(Configuration)\x64\OpenTelemetry.AutoInstrumentation.ClrProfiler.Native.dll"
|
||||
DestinationFolder="$(TracerHomeDirectory)\win-x64"
|
||||
SkipUnchangedFiles="true"
|
||||
Retries="3"
|
||||
RetryDelayMilliseconds="300"/>
|
||||
<Copy Condition="'$(Platform)' == 'x86' OR '$(Platform)' == 'All' OR '$(Buildx86Profiler)' == 'true'"
|
||||
SourceFiles="$(MSBuildThisFileDirectory)src\Datadog.Trace.ClrProfiler.Native\bin\$(Configuration)\x86\OpenTelemetry.AutoInstrumentation.ClrProfiler.Native.dll"
|
||||
DestinationFolder="$(TracerHomeDirectory)\win-x86"
|
||||
SkipUnchangedFiles="true"
|
||||
Retries="3"
|
||||
RetryDelayMilliseconds="300"/>
|
||||
</Target>
|
||||
|
||||
<Target Name="SetMsiProperties">
|
||||
<PropertyGroup>
|
||||
<!-- we need to build both x64 and x86 profilers to build the x64 msi -->
|
||||
<Buildx86Profiler Condition="'$(Platform)' == 'x64' OR '$(Platform)' == 'All'">true</Buildx86Profiler>
|
||||
</PropertyGroup>
|
||||
</Target>
|
||||
|
||||
<Target Name="Msi" DependsOnTargets="SetMsiProperties;CreateHomeDirectory;MsiOnly">
|
||||
</Target>
|
||||
|
||||
<Target Name="CreateHomeDirectory" DependsOnTargets="PublishNativeProfilerOnDisk;PublishManagedProfilerOnDisk;PublishBuildLoggerOnDisk">
|
||||
<Copy
|
||||
SourceFiles="$(MSBuildThisFileDirectory)integrations.json"
|
||||
DestinationFolder="$(TracerHomeDirectory)"
|
||||
SkipUnchangedFiles="true"
|
||||
Retries="3"
|
||||
RetryDelayMilliseconds="300"/>
|
||||
|
||||
<Delete Condition="'$(ZipHomeDirectory)' == 'true'" Files="$(TracerHomeDirectory).zip" />
|
||||
|
||||
<ZipDirectory
|
||||
Condition="'$(ZipHomeDirectory)' == 'true'"
|
||||
SourceDirectory="$(TracerHomeDirectory)"
|
||||
DestinationFile="$(TracerHomeDirectory).zip" />
|
||||
</Target>
|
||||
</Project>
|
|
@ -4,14 +4,14 @@ Datadog.Trace,https://github.com/damianh/LibLog,MIT,Copyright (C) 2011-2017 Dami
|
|||
Datadog.Trace,https://github.com/serilog/serilog,Apache-2.0,Copyright (c) 2013-2018 Serilog Contributors
|
||||
Datadog.Trace,https://github.com/serilog/serilog-sinks-file,Apache-2.0,Copyright (c) 2016 Serilog Contributors
|
||||
Datadog.Trace,https://github.com/JamesNK/Newtonsoft.Json,MIT,Copyright (c) 2007 James Newton-King
|
||||
Datadog.Trace.ClrProfiler.Managed,https://github.com/kevin-montrose/Sigil,MS-PL,2013-2016 Kevin Montrose
|
||||
Datadog.Trace.ClrProfiler.Native,https://github.com/dotnet/runtime,MIT,Copyright (c) .NET Foundation and contributors. All rights reserved.
|
||||
Datadog.Trace.ClrProfiler.Native,https://github.com/Microsoft/clr-samples,MIT,Copyright (c) .NET Foundation and contributors. All rights reserved.
|
||||
Datadog.Trace.ClrProfiler.Native,https://github.com/MicrosoftArchive/clrprofiler,MIT,Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
Datadog.Trace.ClrProfiler.Native,https://github.com/nlohmann/json,MIT,Copyright (c) 2013-2018 Niels Lohmann
|
||||
Datadog.Trace.ClrProfiler.Native,https://github.com/dropbox/miniutf,MIT,"Copyright (c) 2013 Dropbox, Inc."
|
||||
Datadog.Trace.ClrProfiler.Native,https://github.com/gabime/spdlog,MIT,Copyright (c) 2016 Gabi Melman.
|
||||
Datadog.Trace.ClrProfiler.Native,https://github.com/fmtlib/fmt,MIT,"Copyright (c) 2012 - present, Victor Zverovich"
|
||||
OpenTelemetry.AutoInstrumentation.ClrProfiler.Managed,https://github.com/kevin-montrose/Sigil,MS-PL,2013-2016 Kevin Montrose
|
||||
OpenTelemetry.AutoInstrumentation.ClrProfiler.Native,https://github.com/dotnet/runtime,MIT,Copyright (c) .NET Foundation and contributors. All rights reserved.
|
||||
OpenTelemetry.AutoInstrumentation.ClrProfiler.Native,https://github.com/Microsoft/clr-samples,MIT,Copyright (c) .NET Foundation and contributors. All rights reserved.
|
||||
OpenTelemetry.AutoInstrumentation.ClrProfiler.Native,https://github.com/MicrosoftArchive/clrprofiler,MIT,Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
OpenTelemetry.AutoInstrumentation.ClrProfiler.Native,https://github.com/nlohmann/json,MIT,Copyright (c) 2013-2018 Niels Lohmann
|
||||
OpenTelemetry.AutoInstrumentation.ClrProfiler.Native,https://github.com/dropbox/miniutf,MIT,"Copyright (c) 2013 Dropbox, Inc."
|
||||
OpenTelemetry.AutoInstrumentation.ClrProfiler.Native,https://github.com/gabime/spdlog,MIT,Copyright (c) 2016 Gabi Melman.
|
||||
OpenTelemetry.AutoInstrumentation.ClrProfiler.Native,https://github.com/fmtlib/fmt,MIT,"Copyright (c) 2012 - present, Victor Zverovich"
|
||||
Datadog.Trace.OpenTracing,https://github.com/opentracing/opentracing-csharp,MIT,Copyright 2016-2017 The OpenTracing Authors
|
||||
Datadog.Trace.OpenTracing,https://github.com/opentracing-contrib/csharp-netcore,Apache-2.0,
|
||||
(all),https://github.com/DataDog/dd-trace-dotnet,Apache-2.0,
|
||||
|
|
|
|
@ -0,0 +1,62 @@
|
|||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<BuildInParallel Condition="'$(BuildInParallel)' == ''">true</BuildInParallel>
|
||||
<Configuration Condition="'$(Configuration)' == ''">Debug</Configuration>
|
||||
<TracerHomeDirectory Condition="'$(TracerHomeDirectory)' == ''">$(MSBuildThisFileDirectory)src\bin\windows-tracer-home</TracerHomeDirectory>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<CsharpProject Include="src\**\*.csproj" />
|
||||
<CppProject Include="src\**\*.vcxproj"/>
|
||||
<CppTestProject Include="test\**\*.vcxproj"/>
|
||||
<SampleProject Include="test\test-applications\**\*.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="Restore">
|
||||
<MSBuild Targets="Restore" Projects="@(CsharpProject);@(CppProject);@(SampleProject)"/>
|
||||
</Target>
|
||||
|
||||
<Target Name="Clean">
|
||||
<MSBuild Targets="Clean" Projects="@(CsharpProject);@(CppProject);@(SampleProject)"/>
|
||||
</Target>
|
||||
|
||||
<!-- default target -->
|
||||
<Target Name="Build">
|
||||
<MSBuild Targets="Build" Projects="@(CsharpProject);@(CppProject)">
|
||||
<Output TaskParameter="TargetOutputs" ItemName="CollectedBuildOutput"/>
|
||||
</MSBuild>
|
||||
</Target>
|
||||
|
||||
<Target Name="BuildFrameworkReproductions">
|
||||
<MSBuild Targets="Build" Projects="@(FrameworkReproduction)">
|
||||
<Output TaskParameter="TargetOutputs" ItemName="CollectedBuildOutput"/>
|
||||
</MSBuild>
|
||||
</Target>
|
||||
|
||||
<Target Name="BuildCsharp">
|
||||
<MSBuild Targets="Restore" Projects="@(CsharpProject)" Properties="Platform=AnyCPU">
|
||||
<Output TaskParameter="TargetOutputs" ItemName="CollectedBuildOutput"/>
|
||||
</MSBuild>
|
||||
|
||||
<MSBuild Targets="Build" Projects="@(CsharpProject)" Properties="Platform=AnyCPU">
|
||||
<Output TaskParameter="TargetOutputs" ItemName="CollectedBuildOutput"/>
|
||||
</MSBuild>
|
||||
</Target>
|
||||
|
||||
<Target Name="BuildCpp">
|
||||
<MSBuild Targets="Build" Projects="@(CppProject)" Condition="'$(Platform)' == 'x64' OR '$(Platform)' == 'All'" Properties="Platform=x64">
|
||||
<Output TaskParameter="TargetOutputs" ItemName="CollectedBuildOutput"/>
|
||||
</MSBuild>
|
||||
|
||||
<MSBuild Targets="Build" Projects="@(CppProject)" Condition="'$(Platform)' == 'x86' OR '$(Platform)' == 'All' OR '$(Buildx86Profiler)' == 'true'" Properties="Platform=x86">
|
||||
<Output TaskParameter="TargetOutputs" ItemName="CollectedBuildOutput"/>
|
||||
</MSBuild>
|
||||
</Target>
|
||||
|
||||
<Target Name="BuildCppTests">
|
||||
<MSBuild Targets="Build" Projects="@(CppTestProject)">
|
||||
<Output TaskParameter="TargetOutputs" ItemName="CollectedBuildOutput"/>
|
||||
</MSBuild>
|
||||
</Target>
|
||||
|
||||
</Project>
|
|
@ -3,12 +3,12 @@ Microsoft Visual Studio Solution File, Format Version 12.00
|
|||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.28803.452
|
||||
MinimumVisualStudioVersion = 15.0.26124.0
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Datadog.Trace.ClrProfiler.Native", "src\Datadog.Trace.ClrProfiler.Native\Datadog.Trace.ClrProfiler.Native.vcxproj", "{91B6272F-5780-4C94-8071-DBBA7B4F67F3}"
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OpenTelemetry.AutoInstrumentation.ClrProfiler.Native", "src\OpenTelemetry.AutoInstrumentation.ClrProfiler.Native\OpenTelemetry.AutoInstrumentation.ClrProfiler.Native.vcxproj", "{91B6272F-5780-4C94-8071-DBBA7B4F67F3}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{AB8596C1-CFDA-4A5E-9E9C-74A3DF9AED77} = {AB8596C1-CFDA-4A5E-9E9C-74A3DF9AED77}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Datadog.Trace.ClrProfiler.Native.DLL", "src\Datadog.Trace.ClrProfiler.Native\Datadog.Trace.ClrProfiler.Native.DLL.vcxproj", "{C0C8D381-D6B9-4C76-9428-F40F2FA93A9A}"
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OpenTelemetry.AutoInstrumentation.ClrProfiler.Native.DLL", "src\OpenTelemetry.AutoInstrumentation.ClrProfiler.Native\OpenTelemetry.AutoInstrumentation.ClrProfiler.Native.DLL.vcxproj", "{C0C8D381-D6B9-4C76-9428-F40F2FA93A9A}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{AB8596C1-CFDA-4A5E-9E9C-74A3DF9AED77} = {AB8596C1-CFDA-4A5E-9E9C-74A3DF9AED77}
|
||||
EndProjectSection
|
||||
|
@ -22,8 +22,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
|
|||
build.cmd = build.cmd
|
||||
build.ps1 = build.ps1
|
||||
build.sh = build.sh
|
||||
build_poc.sh = build_poc.sh
|
||||
Datadog.Trace.proj = Datadog.Trace.proj
|
||||
Directory.Build.props = Directory.Build.props
|
||||
GlobalSuppressions.cs = GlobalSuppressions.cs
|
||||
integrations.json = integrations.json
|
||||
|
@ -40,7 +38,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{9E5F0022-0A5
|
|||
src\GlobalSuppressions.cs = src\GlobalSuppressions.cs
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Datadog.Trace.ClrProfiler.Managed.Loader", "src\Datadog.Trace.ClrProfiler.Managed.Loader\Datadog.Trace.ClrProfiler.Managed.Loader.csproj", "{AB8596C1-CFDA-4A5E-9E9C-74A3DF9AED77}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenTelemetry.AutoInstrumentation.ClrProfiler.Managed.Loader", "src\OpenTelemetry.AutoInstrumentation.ClrProfiler.Managed.Loader\OpenTelemetry.AutoInstrumentation.ClrProfiler.Managed.Loader.csproj", "{AB8596C1-CFDA-4A5E-9E9C-74A3DF9AED77}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Samples.AspNetCoreMvc31", "samples\Samples.AspNetCoreMvc31\Samples.AspNetCoreMvc31.csproj", "{303F8E41-691F-4453-AB7D-88A0036C0465}"
|
||||
EndProject
|
||||
|
@ -67,7 +65,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OldReference", "samples\Old
|
|||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{67941CB3-DC46-4E26-B7BF-8B27A298A2E8}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Datadog.Trace.ClrProfiler.Native.Tests", "test\Datadog.Trace.ClrProfiler.Native.Tests\Datadog.Trace.ClrProfiler.Native.Tests.vcxproj", "{5728056A-51AA-4FF5-AD0C-E86E44E36102}"
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OpenTelemetry.AutoInstrumentation.ClrProfiler.Native.Tests", "test\OpenTelemetry.AutoInstrumentation.ClrProfiler.Native.Tests\OpenTelemetry.AutoInstrumentation.ClrProfiler.Native.Tests.vcxproj", "{5728056A-51AA-4FF5-AD0C-E86E44E36102}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test-applications", "test-applications", "{7A9D19CA-E5FF-4FB1-A89A-B1C92BEC8982}"
|
||||
EndProject
|
|
@ -33,7 +33,7 @@ It would be good to have some automation here to test without doing to much stuf
|
|||
|
||||
1. Remove `Datadog.Trace.Tracer` and a lot of related code.
|
||||
We can just keep the AutoInstrumentation integration boilerplate for HTTP Client and ASP.NET.
|
||||
1. Change the `Datadog.Trace.ClrProfiler.Instrumentation.Initialize()` method
|
||||
1. Change the `OpenTelemetry.AutoInstrumentation.ClrProfiler.Instrumentation.Initialize()` method
|
||||
so that it will be the place where the global OTel trace provider will be configured.
|
||||
|
||||
It would be good to have a checkpoint here where the instrumented application is NOOP-instrumented.
|
||||
|
@ -45,7 +45,7 @@ It would be good to have a checkpoint here where the instrumented application is
|
|||
[question](https://cloud-native.slack.com/archives/C01N3BC2W7Q/p1620994235161800)
|
||||
1. Add manual instrumentation to the applications.
|
||||
1. Try auto-instrumentation using ActivitySource
|
||||
e.g. in `Datadog.Trace.ClrProfiler.AutoInstrumentation.Http.HttpClient.HttpMessageHandlerCommon`.
|
||||
e.g. in `OpenTelemetry.AutoInstrumentation.ClrProfiler.AutoInstrumentation.Http.HttpClient.HttpMessageHandlerCommon`.
|
||||
1. Test with different versions of OTel SDK in runtime.
|
||||
1. Try using `AppDomain.CurrentDomain.AssemblyResolve +=` to add a fallback
|
||||
if the instrumented app does not reference the OTel SDK.
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
public static class ArtifactNames
|
||||
{
|
||||
public const string NativeProfiler = "OpenTelemetry.AutoInstrumentation.ClrProfiler.Native";
|
||||
}
|
|
@ -44,7 +44,7 @@ partial class Build
|
|||
|
||||
// Copy Native file
|
||||
CopyFileToDirectory(
|
||||
NativeProfilerProject.Directory / "build" / "bin" / $"{ArtifactNames.NativeProfiler}.so",
|
||||
NativeProfilerProject.Directory / "build" / "bin" / $"{NativeProfilerProject.Name}.so",
|
||||
TracerHomeDirectory,
|
||||
FileExistsPolicy.Overwrite);
|
||||
});
|
||||
|
|
|
@ -30,7 +30,7 @@ partial class Build
|
|||
|
||||
// Create home directory
|
||||
CopyFileToDirectory(
|
||||
NativeProfilerProject.Directory / "bin" / $"{ArtifactNames.NativeProfiler}.dylib",
|
||||
NativeProfilerProject.Directory / "bin" / $"{NativeProfilerProject.Name}.dylib",
|
||||
TracerHomeDirectory,
|
||||
FileExistsPolicy.Overwrite);
|
||||
});
|
||||
|
|
|
@ -63,7 +63,7 @@ partial class Build
|
|||
foreach (var architecture in ArchitecturesForPlatform)
|
||||
{
|
||||
var source = NativeProfilerProject.Directory / "bin" / BuildConfiguration / architecture.ToString() /
|
||||
$"{ArtifactNames.NativeProfiler}.dll";
|
||||
$"{NativeProfilerProject.Name}.dll";
|
||||
var dest = TracerHomeDirectory / $"win-{architecture}";
|
||||
|
||||
Logger.Info($"Copying '{source}' to '{dest}'");
|
||||
|
@ -79,8 +79,9 @@ partial class Build
|
|||
.OnlyWhenStatic(() => IsWin)
|
||||
.Executes(() =>
|
||||
{
|
||||
var workingDirectory = TestsDirectory / "Datadog.Trace.ClrProfiler.Native.Tests" / "bin" / BuildConfiguration.ToString() / Platform.ToString();
|
||||
var exePath = workingDirectory / "Datadog.Trace.ClrProfiler.Native.Tests.exe";
|
||||
var project = Solution.GetProject(Projects.Tests.ClrProfilerNativeTests);
|
||||
var workingDirectory = project.Directory / "bin" / BuildConfiguration.ToString() / Platform.ToString();
|
||||
var exePath = workingDirectory / $"{project.Name}.exe";
|
||||
var testExe = ToolResolver.GetLocalTool(exePath);
|
||||
|
||||
testExe("--gtest_output=xml", workingDirectory: workingDirectory);
|
||||
|
|
|
@ -15,8 +15,8 @@ using static Nuke.Common.Tools.DotNet.DotNetTasks;
|
|||
|
||||
partial class Build
|
||||
{
|
||||
[Solution("Datadog.Trace.sln")] readonly Solution Solution;
|
||||
AbsolutePath MsBuildProject => RootDirectory / "Datadog.Trace.proj";
|
||||
[Solution("OpenTelemetry.AutoInstrumentation.sln")] readonly Solution Solution;
|
||||
AbsolutePath MsBuildProject => RootDirectory / "OpenTelemetry.AutoInstrumentation.proj";
|
||||
|
||||
AbsolutePath OutputDirectory => RootDirectory / "bin";
|
||||
AbsolutePath SourceDirectory => RootDirectory / "src";
|
||||
|
|
|
@ -19,7 +19,7 @@ using static Nuke.Common.IO.FileSystemTasks;
|
|||
InvokedTargets = new[] { nameof(Workflow) })]
|
||||
partial class Build : NukeBuild
|
||||
{
|
||||
public static int Main () => Execute<Build>(x => x.BuildTracer);
|
||||
public static int Main() => Execute<Build>(x => x.BuildTracer);
|
||||
|
||||
[Parameter("Configuration to build - Default is 'Release'")]
|
||||
readonly Configuration BuildConfiguration = Configuration.Release;
|
||||
|
|
|
@ -2,5 +2,10 @@ public static class Projects
|
|||
{
|
||||
public const string ClrProfilerManaged = "OpenTelemetry.AutoInstrumentation.ClrProfiler.Managed";
|
||||
public const string ClrProfilerManagedCore = "OpenTelemetry.AutoInstrumentation.ClrProfiler.Managed.Core";
|
||||
public const string ClrProfilerNative = "Datadog.Trace.ClrProfiler.Native";
|
||||
public const string ClrProfilerNative = "OpenTelemetry.AutoInstrumentation.ClrProfiler.Native";
|
||||
|
||||
public static class Tests
|
||||
{
|
||||
public const string ClrProfilerNativeTests = "OpenTelemetry.AutoInstrumentation.ClrProfiler.Native.Tests";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@ rem Set default values
|
|||
set profiler_platform=x64
|
||||
set profiler_configuration=Debug
|
||||
set start_visual_studio=true
|
||||
set vs_sln_name=Datadog.Trace.sln
|
||||
set vs_sln_name=OpenTelemetry.AutoInstrumentation.sln
|
||||
|
||||
:next_argument
|
||||
set devenv_arg1=%1
|
||||
|
@ -40,12 +40,12 @@ echo Enabling profiler for "%profiler_configuration%/%profiler_platform%".
|
|||
rem Enable .NET Framework Profiling API
|
||||
SET COR_ENABLE_PROFILING=1
|
||||
SET COR_PROFILER={918728DD-259F-4A6A-AC2B-B85E1B658318}
|
||||
SET COR_PROFILER_PATH=%~dp0\src\Datadog.Trace.ClrProfiler.Native\bin\%profiler_configuration%\%profiler_platform%\OpenTelemetry.AutoInstrumentation.ClrProfiler.Native.dll
|
||||
SET COR_PROFILER_PATH=%~dp0\src\OpenTelemetry.AutoInstrumentation.ClrProfiler.Native\bin\%profiler_configuration%\%profiler_platform%\OpenTelemetry.AutoInstrumentation.ClrProfiler.Native.dll
|
||||
|
||||
rem Enable .NET Core Profiling API
|
||||
SET CORECLR_ENABLE_PROFILING=1
|
||||
SET CORECLR_PROFILER={918728DD-259F-4A6A-AC2B-B85E1B658318}
|
||||
SET CORECLR_PROFILER_PATH=%~dp0\src\Datadog.Trace.ClrProfiler.Native\bin\%profiler_configuration%\%profiler_platform%\OpenTelemetry.AutoInstrumentation.ClrProfiler.Native.dll
|
||||
SET CORECLR_PROFILER_PATH=%~dp0\src\OpenTelemetry.AutoInstrumentation.ClrProfiler.Native\bin\%profiler_configuration%\%profiler_platform%\OpenTelemetry.AutoInstrumentation.ClrProfiler.Native.dll
|
||||
|
||||
rem Don't attach the profiler to these processes
|
||||
SET OTEL_PROFILER_EXCLUDE_PROCESSES=devenv.exe;Microsoft.ServiceHub.Controller.exe;ServiceHub.Host.CLR.exe;ServiceHub.TestWindowStoreHost.exe;ServiceHub.DataWarehouseHost.exe;sqlservr.exe;VBCSCompiler.exe;iisexpresstray.exe;msvsmon.exe;PerfWatson2.exe;ServiceHub.IdentityHost.exe;ServiceHub.VSDetouredHost.exe;ServiceHub.SettingsHost.exe;ServiceHub.Host.CLR.x86.exe;vstest.console.exe;ServiceHub.RoslynCodeAnalysisService32.exe;testhost.x86.exe;MSBuild.exe;ServiceHub.ThreadedWaitDialog.exe
|
||||
|
|
|
@ -51,9 +51,9 @@ cp -r .vscode.example .vscode
|
|||
|
||||
Because of [Mono missing features](https://github.com/OmniSharp/omnisharp-vscode#note-about-using-net-5-sdks), `omnisharp.useGlobalMono` has to be set to `never`. Go to `File` -> `Preferences` -> `Settings` -> `Extensions` -> `C# Configuration` -> Change `Omnisharp: Use Global Mono` (you can search for it if the menu is too long) to `never`. Afterwards, you have restart OmniSharp: `F1` -> `OmniSharp: Restart OmniSharp`.
|
||||
|
||||
There may be a lot of errors, because some projects target .NET Framework. Switch to `Datadog.Trace.Minimal.sln` using `F1` -> `OmniSharp: Select Project` in Visual Studio Code to load a subset of projects which work without any issues. You can also try building the projects which have errors as it sometimes helps.
|
||||
There may be a lot of errors, because some projects target .NET Framework. Switch to `OpenTelemetry.AutoInstrumentation.sln` using `F1` -> `OmniSharp: Select Project` in Visual Studio Code to load a subset of projects which work without any issues. You can also try building the projects which have errors as it sometimes helps.
|
||||
|
||||
If for whatever reason you need to use `Datadog.Trace.sln` you can run `for i in **/*.csproj; do dotnet build $i; done` to decrease the number of errors.
|
||||
If for whatever reason you need to use `OpenTelemetry.AutoInstrumentation.sln` you can run `for i in **/*.csproj; do dotnet build $i; done` to decrease the number of errors.
|
||||
|
||||
## Development Container
|
||||
|
||||
|
|
|
@ -16,13 +16,13 @@ namespace Samples.AspNetCoreMvc.Controllers
|
|||
|
||||
public IActionResult Index()
|
||||
{
|
||||
var instrumentationType = Type.GetType("Datadog.Trace.ClrProfiler.Instrumentation, OpenTelemetry.AutoInstrumentation.ClrProfiler.Managed");
|
||||
var instrumentationType = Type.GetType("OpenTelemetry.AutoInstrumentation.ClrProfiler.Instrumentation, OpenTelemetry.AutoInstrumentation.ClrProfiler.Managed");
|
||||
ViewBag.ProfilerAttached = instrumentationType?.GetProperty("ProfilerAttached", BindingFlags.Public | BindingFlags.Static)?.GetValue(null) ?? false;
|
||||
ViewBag.TracerAssemblyLocation = Type.GetType("Datadog.Trace.Tracer, OpenTelemetry.AutoInstrumentation")?.Assembly.Location;
|
||||
ViewBag.TracerAssemblyLocation = Type.GetType("OpenTelemetry.Trace.Tracer, OpenTelemetry.Api")?.Assembly.Location;
|
||||
ViewBag.ClrProfilerAssemblyLocation = instrumentationType?.Assembly.Location;
|
||||
ViewBag.StackTrace = StackTraceHelper.GetUsefulStack();
|
||||
|
||||
var prefixes = new[] { "COR_", "CORECLR_", "OTEL_", "DATADOG_" };
|
||||
var prefixes = new[] { "COR_", "CORECLR_", "OTEL_" };
|
||||
|
||||
var envVars = from envVar in Environment.GetEnvironmentVariables().Cast<DictionaryEntry>()
|
||||
from prefix in prefixes
|
||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -7,7 +7,7 @@ using System;
|
|||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
namespace Datadog.Trace.ClrProfiler.Managed.Loader
|
||||
namespace OpenTelemetry.AutoInstrumentation.ClrProfiler.Managed.Loader
|
||||
{
|
||||
internal sealed class FileSink : IDisposable
|
||||
{
|
|
@ -2,7 +2,7 @@
|
|||
using System.Reflection;
|
||||
using System.Runtime.Loader;
|
||||
|
||||
namespace Datadog.Trace.ClrProfiler.Managed.Loader
|
||||
namespace OpenTelemetry.AutoInstrumentation.ClrProfiler.Managed.Loader
|
||||
{
|
||||
internal class ManagedProfilerAssemblyLoadContext : AssemblyLoadContext
|
||||
{
|
|
@ -1,7 +1,7 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<RootNamespace>Datadog.Trace.ClrProfiler.Managed.Loader</RootNamespace>
|
||||
<RootNamespace>OpenTelemetry.AutoInstrumentation.ClrProfiler.Managed.Loader</RootNamespace>
|
||||
<TargetFrameworks Condition="'$(OS)' == 'Windows_NT'">net45;netcoreapp2.0</TargetFrameworks>
|
||||
<TargetFrameworks Condition="'$(OS)' != 'Windows_NT'">netcoreapp2.0</TargetFrameworks>
|
||||
<OutputPath>..\bin\ProfilerResources\</OutputPath>
|
|
@ -3,7 +3,7 @@ using System;
|
|||
using System.IO;
|
||||
using System.Reflection;
|
||||
|
||||
namespace Datadog.Trace.ClrProfiler.Managed.Loader
|
||||
namespace OpenTelemetry.AutoInstrumentation.ClrProfiler.Managed.Loader
|
||||
{
|
||||
/// <summary>
|
||||
/// A class that attempts to load the OpenTelemetry.AutoInstrumentation.ClrProfiler.Managed .NET assembly.
|
|
@ -4,7 +4,7 @@ using System;
|
|||
using System.IO;
|
||||
using System.Reflection;
|
||||
|
||||
namespace Datadog.Trace.ClrProfiler.Managed.Loader
|
||||
namespace OpenTelemetry.AutoInstrumentation.ClrProfiler.Managed.Loader
|
||||
{
|
||||
/// <summary>
|
||||
/// A class that attempts to load the OpenTelemetry.AutoInstrumentation.ClrProfiler.Managed .NET assembly.
|
|
@ -2,7 +2,7 @@ using System;
|
|||
using System.IO;
|
||||
using System.Reflection;
|
||||
|
||||
namespace Datadog.Trace.ClrProfiler.Managed.Loader
|
||||
namespace OpenTelemetry.AutoInstrumentation.ClrProfiler.Managed.Loader
|
||||
{
|
||||
/// <summary>
|
||||
/// A class that attempts to load the OpenTelemetry.AutoInstrumentation.ClrProfiler.Managed .NET assembly.
|
|
@ -2,7 +2,7 @@ using System;
|
|||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
|
||||
namespace Datadog.Trace.ClrProfiler.Managed.Loader
|
||||
namespace OpenTelemetry.AutoInstrumentation.ClrProfiler.Managed.Loader
|
||||
{
|
||||
internal static class StartupLogger
|
||||
{
|
|
@ -187,7 +187,6 @@ namespace OpenTelemetry.AutoInstrumentation.ClrProfiler.Managed.Configuration
|
|||
|
||||
internal static Settings FromDefaultSources()
|
||||
{
|
||||
// env > AppSettings > datadog.json
|
||||
var configurationSource = new CompositeConfigurationSource
|
||||
{
|
||||
new EnvironmentConfigurationSource(),
|
||||
|
|
|
@ -5,7 +5,7 @@ cmake_policy(SET CMP0015 NEW)
|
|||
# Project definition
|
||||
# ******************************************************
|
||||
|
||||
project("Datadog.Trace.ClrProfiler.Native" VERSION 0.0.1)
|
||||
project("OpenTelemetry.AutoInstrumentation.ClrProfiler.Native" VERSION 0.0.1)
|
||||
|
||||
# ******************************************************
|
||||
# Environment detection
|
||||
|
@ -73,9 +73,9 @@ else()
|
|||
endif()
|
||||
|
||||
if (NOT EXISTS ${CMAKE_SOURCE_DIR}/../bin/ProfilerResources/netcoreapp2.0)
|
||||
message(FATAL_ERROR "Datadog.Trace.ClrProfiler.Loader must be build first.")
|
||||
message(FATAL_ERROR "OpenTelemetry.AutoInstrumentation.ClrProfiler.Managed.Loader must be build first.")
|
||||
else()
|
||||
message(STATUS "Datadog.Trace.ClrProfiler.Loader was found")
|
||||
message(STATUS "OpenTelemetry.AutoInstrumentation.ClrProfiler.Managed.Loader was found")
|
||||
endif()
|
||||
|
||||
# ******************************************************
|
||||
|
@ -129,34 +129,34 @@ SET(MANAGED_LOADER_DIRECTORY ${CMAKE_SOURCE_DIR}/../bin/ProfilerResources/netcor
|
|||
# Set specific custom commands to embed the loader
|
||||
if (ISMACOS)
|
||||
add_custom_command(
|
||||
OUTPUT ${OUTPUT_TMP_DIR}/Datadog.Trace.ClrProfiler.Managed.Loader.dll.o
|
||||
COMMAND touch stub.c && gcc -o stub.o -c stub.c && cp ${MANAGED_LOADER_DIRECTORY}/Datadog.Trace.ClrProfiler.Managed.Loader.dll Datadog.Trace.ClrProfiler.Managed.Loader.dll && ld -r -o Datadog.Trace.ClrProfiler.Managed.Loader.dll.o -sectcreate binary dll Datadog.Trace.ClrProfiler.Managed.Loader.dll stub.o
|
||||
DEPENDS ${MANAGED_LOADER_DIRECTORY}/Datadog.Trace.ClrProfiler.Managed.Loader.dll ${OUTPUT_DEPS_DIR}/json ${OUTPUT_DEPS_DIR}/re2 ${OUTPUT_DEPS_DIR}/fmt
|
||||
OUTPUT ${OUTPUT_TMP_DIR}/OpenTelemetry.AutoInstrumentation.ClrProfiler.Managed.Loader.dll.o
|
||||
COMMAND touch stub.c && gcc -o stub.o -c stub.c && cp ${MANAGED_LOADER_DIRECTORY}/OpenTelemetry.AutoInstrumentation.ClrProfiler.Managed.Loader.dll OpenTelemetry.AutoInstrumentation.ClrProfiler.Managed.Loader.dll && ld -r -o OpenTelemetry.AutoInstrumentation.ClrProfiler.Managed.Loader.dll.o -sectcreate binary dll OpenTelemetry.AutoInstrumentation.ClrProfiler.Managed.Loader.dll stub.o
|
||||
DEPENDS ${MANAGED_LOADER_DIRECTORY}/OpenTelemetry.AutoInstrumentation.ClrProfiler.Managed.Loader.dll ${OUTPUT_DEPS_DIR}/json ${OUTPUT_DEPS_DIR}/re2 ${OUTPUT_DEPS_DIR}/fmt
|
||||
WORKING_DIRECTORY ${OUTPUT_TMP_DIR}
|
||||
)
|
||||
add_custom_command(
|
||||
OUTPUT ${OUTPUT_TMP_DIR}/Datadog.Trace.ClrProfiler.Managed.Loader.pdb.o
|
||||
COMMAND touch stub.c && gcc -o stub.o -c stub.c && cp "${MANAGED_LOADER_DIRECTORY}/Datadog.Trace.ClrProfiler.Managed.Loader.pdb" Datadog.Trace.ClrProfiler.Managed.Loader.pdb && ld -r -o Datadog.Trace.ClrProfiler.Managed.Loader.pdb.o -sectcreate binary pdb Datadog.Trace.ClrProfiler.Managed.Loader.pdb stub.o
|
||||
DEPENDS ${MANAGED_LOADER_DIRECTORY}/Datadog.Trace.ClrProfiler.Managed.Loader.pdb ${OUTPUT_DEPS_DIR}/json ${OUTPUT_DEPS_DIR}/re2 ${OUTPUT_DEPS_DIR}/fmt
|
||||
OUTPUT ${OUTPUT_TMP_DIR}/OpenTelemetry.AutoInstrumentation.ClrProfiler.Managed.Loader.pdb.o
|
||||
COMMAND touch stub.c && gcc -o stub.o -c stub.c && cp "${MANAGED_LOADER_DIRECTORY}/OpenTelemetry.AutoInstrumentation.ClrProfiler.Managed.Loader.pdb" OpenTelemetry.AutoInstrumentation.ClrProfiler.Managed.Loader.pdb && ld -r -o OpenTelemetry.AutoInstrumentation.ClrProfiler.Managed.Loader.pdb.o -sectcreate binary pdb OpenTelemetry.AutoInstrumentation.ClrProfiler.Managed.Loader.pdb stub.o
|
||||
DEPENDS ${MANAGED_LOADER_DIRECTORY}/OpenTelemetry.AutoInstrumentation.ClrProfiler.Managed.Loader.pdb ${OUTPUT_DEPS_DIR}/json ${OUTPUT_DEPS_DIR}/re2 ${OUTPUT_DEPS_DIR}/fmt
|
||||
WORKING_DIRECTORY ${OUTPUT_TMP_DIR}
|
||||
)
|
||||
elseif(ISLINUX)
|
||||
add_custom_command(
|
||||
OUTPUT ${OUTPUT_TMP_DIR}/Datadog.Trace.ClrProfiler.Managed.Loader.dll.o
|
||||
COMMAND cp "${MANAGED_LOADER_DIRECTORY}/Datadog.Trace.ClrProfiler.Managed.Loader.dll" Datadog.Trace.ClrProfiler.Managed.Loader.dll && ld -r -b binary -o Datadog.Trace.ClrProfiler.Managed.Loader.dll.o Datadog.Trace.ClrProfiler.Managed.Loader.dll
|
||||
DEPENDS ${MANAGED_LOADER_DIRECTORY}/Datadog.Trace.ClrProfiler.Managed.Loader.dll ${OUTPUT_DEPS_DIR}/json ${OUTPUT_DEPS_DIR}/re2 ${OUTPUT_DEPS_DIR}/fmt
|
||||
OUTPUT ${OUTPUT_TMP_DIR}/OpenTelemetry.AutoInstrumentation.ClrProfiler.Managed.Loader.dll.o
|
||||
COMMAND cp "${MANAGED_LOADER_DIRECTORY}/OpenTelemetry.AutoInstrumentation.ClrProfiler.Managed.Loader.dll" OpenTelemetry.AutoInstrumentation.ClrProfiler.Managed.Loader.dll && ld -r -b binary -o OpenTelemetry.AutoInstrumentation.ClrProfiler.Managed.Loader.dll.o OpenTelemetry.AutoInstrumentation.ClrProfiler.Managed.Loader.dll
|
||||
DEPENDS ${MANAGED_LOADER_DIRECTORY}/OpenTelemetry.AutoInstrumentation.ClrProfiler.Managed.Loader.dll ${OUTPUT_DEPS_DIR}/json ${OUTPUT_DEPS_DIR}/re2 ${OUTPUT_DEPS_DIR}/fmt
|
||||
WORKING_DIRECTORY ${OUTPUT_TMP_DIR}
|
||||
)
|
||||
add_custom_command(
|
||||
OUTPUT ${OUTPUT_TMP_DIR}/Datadog.Trace.ClrProfiler.Managed.Loader.pdb.o
|
||||
COMMAND cp "${MANAGED_LOADER_DIRECTORY}/Datadog.Trace.ClrProfiler.Managed.Loader.pdb" Datadog.Trace.ClrProfiler.Managed.Loader.pdb && ld -r -b binary -o Datadog.Trace.ClrProfiler.Managed.Loader.pdb.o Datadog.Trace.ClrProfiler.Managed.Loader.pdb
|
||||
DEPENDS ${MANAGED_LOADER_DIRECTORY}/Datadog.Trace.ClrProfiler.Managed.Loader.pdb ${OUTPUT_DEPS_DIR}/json ${OUTPUT_DEPS_DIR}/re2 ${OUTPUT_DEPS_DIR}/fmt
|
||||
OUTPUT ${OUTPUT_TMP_DIR}/OpenTelemetry.AutoInstrumentation.ClrProfiler.Managed.Loader.pdb.o
|
||||
COMMAND cp "${MANAGED_LOADER_DIRECTORY}/OpenTelemetry.AutoInstrumentation.ClrProfiler.Managed.Loader.pdb" OpenTelemetry.AutoInstrumentation.ClrProfiler.Managed.Loader.pdb && ld -r -b binary -o OpenTelemetry.AutoInstrumentation.ClrProfiler.Managed.Loader.pdb.o OpenTelemetry.AutoInstrumentation.ClrProfiler.Managed.Loader.pdb
|
||||
DEPENDS ${MANAGED_LOADER_DIRECTORY}/OpenTelemetry.AutoInstrumentation.ClrProfiler.Managed.Loader.pdb ${OUTPUT_DEPS_DIR}/json ${OUTPUT_DEPS_DIR}/re2 ${OUTPUT_DEPS_DIR}/fmt
|
||||
WORKING_DIRECTORY ${OUTPUT_TMP_DIR}
|
||||
)
|
||||
endif()
|
||||
SET(GENERATED_OBJ_FILES
|
||||
${OUTPUT_TMP_DIR}/Datadog.Trace.ClrProfiler.Managed.Loader.dll.o
|
||||
${OUTPUT_TMP_DIR}/Datadog.Trace.ClrProfiler.Managed.Loader.pdb.o
|
||||
${OUTPUT_TMP_DIR}/OpenTelemetry.AutoInstrumentation.ClrProfiler.Managed.Loader.dll.o
|
||||
${OUTPUT_TMP_DIR}/OpenTelemetry.AutoInstrumentation.ClrProfiler.Managed.Loader.pdb.o
|
||||
)
|
||||
SET_SOURCE_FILES_PROPERTIES(
|
||||
${GENERATED_OBJ_FILES}
|
||||
|
@ -200,7 +200,7 @@ endif()
|
|||
# ******************************************************
|
||||
# Define static target
|
||||
# ******************************************************
|
||||
add_library("Datadog.Trace.ClrProfiler.Native.static" STATIC
|
||||
add_library("OpenTelemetry.AutoInstrumentation.ClrProfiler.Native.static" STATIC
|
||||
class_factory.cpp
|
||||
clr_helpers.cpp
|
||||
cor_profiler_base.cpp
|
||||
|
@ -221,10 +221,10 @@ add_library("Datadog.Trace.ClrProfiler.Native.static" STATIC
|
|||
${GENERATED_OBJ_FILES}
|
||||
)
|
||||
|
||||
set_target_properties("Datadog.Trace.ClrProfiler.Native.static" PROPERTIES PREFIX "")
|
||||
set_target_properties("OpenTelemetry.AutoInstrumentation.ClrProfiler.Native.static" PROPERTIES PREFIX "")
|
||||
|
||||
# Define directories includes
|
||||
target_include_directories("Datadog.Trace.ClrProfiler.Native.static"
|
||||
target_include_directories("OpenTelemetry.AutoInstrumentation.ClrProfiler.Native.static"
|
||||
PUBLIC lib/coreclr/src/pal/inc/rt
|
||||
PUBLIC lib/coreclr/src/pal/prebuilt/inc
|
||||
PUBLIC lib/coreclr/src/pal/inc
|
||||
|
@ -237,12 +237,12 @@ target_include_directories("Datadog.Trace.ClrProfiler.Native.static"
|
|||
|
||||
# Define linker libraries
|
||||
if (ISMACOS)
|
||||
target_link_libraries("Datadog.Trace.ClrProfiler.Native.static"
|
||||
target_link_libraries("OpenTelemetry.AutoInstrumentation.ClrProfiler.Native.static"
|
||||
${OUTPUT_DEPS_DIR}/re2/obj/libre2.a
|
||||
${OUTPUT_DEPS_DIR}/fmt/libfmt.a
|
||||
)
|
||||
elseif(ISLINUX)
|
||||
target_link_libraries("Datadog.Trace.ClrProfiler.Native.static"
|
||||
target_link_libraries("OpenTelemetry.AutoInstrumentation.ClrProfiler.Native.static"
|
||||
${OUTPUT_DEPS_DIR}/re2/obj/libre2.a
|
||||
${OUTPUT_DEPS_DIR}/fmt/libfmt.a
|
||||
-static-libgcc
|
||||
|
@ -270,4 +270,4 @@ endif()
|
|||
set_target_properties(${TARGET_NAME} PROPERTIES PREFIX "")
|
||||
|
||||
# Define linker libraries
|
||||
target_link_libraries(${TARGET_NAME} "Datadog.Trace.ClrProfiler.Native.static")
|
||||
target_link_libraries(${TARGET_NAME} "OpenTelemetry.AutoInstrumentation.ClrProfiler.Native.static")
|
|
@ -23,12 +23,13 @@
|
|||
<ProjectGuid>{C0C8D381-D6B9-4C76-9428-F40F2FA93A9A}</ProjectGuid>
|
||||
<RootNamespace>DatadogTraceClrProfilerNativeDLL</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
<LIB_PATH>..\..\src\Datadog.Trace.ClrProfiler.Native\lib\</LIB_PATH>
|
||||
<LIB_PATH>..\..\src\OpenTelemetry.AutoInstrumentation.ClrProfiler.Native\lib\</LIB_PATH>
|
||||
<LIB_PLATFORM Condition="'$(Platform)'=='x64'">x64</LIB_PLATFORM>
|
||||
<LIB_PLATFORM Condition="'$(Platform)'=='Win32' OR '$(Platform)'=='x86'">x86</LIB_PLATFORM>
|
||||
<LIB_INCLUDES>$(LIB_PATH)fmt_$(LIB_PLATFORM)-windows-static\include;$(LIB_PATH)spdlog\include;$(LIB_PATH)coreclr\src\pal\prebuilt\inc</LIB_INCLUDES>
|
||||
<LIB_BINARIES Condition="'$(Configuration)'=='Release'">$(LIB_PATH)fmt_$(LIB_PLATFORM)-windows-static\lib\fmt.lib</LIB_BINARIES>
|
||||
<LIB_BINARIES Condition="'$(Configuration)'=='Debug'">$(LIB_PATH)fmt_$(LIB_PLATFORM)-windows-static\debug\lib\fmtd.lib</LIB_BINARIES>
|
||||
<ProjectName>OpenTelemetry.AutoInstrumentation.ClrProfiler.Native.DLL</ProjectName>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
|
@ -114,7 +115,7 @@
|
|||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ModuleDefinitionFile>.\Datadog.Trace.ClrProfiler.Native.def</ModuleDefinitionFile>
|
||||
<ModuleDefinitionFile>.\OpenTelemetry.AutoInstrumentation.ClrProfiler.Native.def</ModuleDefinitionFile>
|
||||
</Link>
|
||||
<PreBuildEvent>
|
||||
<Command>IF EXIST $(SolutionDir)\pre-build-events-cpp.bat CALL $(SolutionDir)\pre-build-events-cpp.bat "$(TargetPath)" "$(TargetFileName)" "$(TargetDir)" "$(TargetName)"</Command>
|
||||
|
@ -137,7 +138,7 @@
|
|||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ModuleDefinitionFile>.\Datadog.Trace.ClrProfiler.Native.def</ModuleDefinitionFile>
|
||||
<ModuleDefinitionFile>.\OpenTelemetry.AutoInstrumentation.ClrProfiler.Native.def</ModuleDefinitionFile>
|
||||
</Link>
|
||||
<PreBuildEvent>
|
||||
<Command>IF EXIST $(SolutionDir)\pre-build-events-cpp.bat CALL $(SolutionDir)\pre-build-events-cpp.bat "$(TargetPath)" "$(TargetFileName)" "$(TargetDir)" "$(TargetName)"</Command>
|
||||
|
@ -164,7 +165,7 @@
|
|||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<ModuleDefinitionFile>.\Datadog.Trace.ClrProfiler.Native.def</ModuleDefinitionFile>
|
||||
<ModuleDefinitionFile>.\OpenTelemetry.AutoInstrumentation.ClrProfiler.Native.def</ModuleDefinitionFile>
|
||||
</Link>
|
||||
<PreBuildEvent>
|
||||
<Command>IF EXIST $(SolutionDir)\pre-build-events-cpp.bat CALL $(SolutionDir)\pre-build-events-cpp.bat "$(TargetPath)" "$(TargetFileName)" "$(TargetDir)" "$(TargetName)"</Command>
|
||||
|
@ -191,7 +192,7 @@
|
|||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<ModuleDefinitionFile>.\Datadog.Trace.ClrProfiler.Native.def</ModuleDefinitionFile>
|
||||
<ModuleDefinitionFile>.\OpenTelemetry.AutoInstrumentation.ClrProfiler.Native.def</ModuleDefinitionFile>
|
||||
</Link>
|
||||
<PreBuildEvent>
|
||||
<Command>IF EXIST $(SolutionDir)\pre-build-events-cpp.bat CALL $(SolutionDir)\pre-build-events-cpp.bat "$(TargetPath)" "$(TargetFileName)" "$(TargetDir)" "$(TargetName)"</Command>
|
||||
|
@ -199,12 +200,12 @@
|
|||
</PreBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="Datadog.Trace.ClrProfiler.Native.vcxproj">
|
||||
<ProjectReference Include="OpenTelemetry.AutoInstrumentation.ClrProfiler.Native.vcxproj">
|
||||
<Project>{91b6272f-5780-4c94-8071-dbba7b4f67f3}</Project>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Datadog.Trace.ClrProfiler.Native.def" />
|
||||
<None Include="OpenTelemetry.AutoInstrumentation.ClrProfiler.Native.def" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="dllmain.cpp" />
|
|
@ -24,7 +24,7 @@
|
|||
<RootNamespace>ClrProfiler</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
<CORECLR_PATH>lib\coreclr</CORECLR_PATH>
|
||||
<ProjectName>Datadog.Trace.ClrProfiler.Native</ProjectName>
|
||||
<ProjectName>OpenTelemetry.AutoInstrumentation.ClrProfiler.Native</ProjectName>
|
||||
<LIB_PATH>lib\</LIB_PATH>
|
||||
<LIB_PLATFORM Condition="'$(Platform)'=='x64'">x64</LIB_PLATFORM>
|
||||
<LIB_PLATFORM Condition="'$(Platform)'=='Win32' OR '$(Platform)'=='x86'">x86</LIB_PLATFORM>
|
|
@ -89,10 +89,10 @@ END
|
|||
// ASSEMBLY
|
||||
//
|
||||
|
||||
NETCOREAPP20_MANAGED_ENTRYPOINT_DLL ASSEMBLY "..\\bin\\ProfilerResources\\netcoreapp2.0\\Datadog.Trace.ClrProfiler.Managed.Loader.dll"
|
||||
NETCOREAPP20_MANAGED_ENTRYPOINT_SYMBOLS SYMBOLS "..\\bin\\ProfilerResources\\netcoreapp2.0\\Datadog.Trace.ClrProfiler.Managed.Loader.pdb"
|
||||
NET45_MANAGED_ENTRYPOINT_DLL ASSEMBLY "..\\bin\\ProfilerResources\\net45\\Datadog.Trace.ClrProfiler.Managed.Loader.dll"
|
||||
NET45_MANAGED_ENTRYPOINT_SYMBOLS SYMBOLS "..\\bin\\ProfilerResources\\net45\\Datadog.Trace.ClrProfiler.Managed.Loader.pdb"
|
||||
NETCOREAPP20_MANAGED_ENTRYPOINT_DLL ASSEMBLY "..\\bin\\ProfilerResources\\netcoreapp2.0\\OpenTelemetry.AutoInstrumentation.ClrProfiler.Managed.Loader.dll"
|
||||
NETCOREAPP20_MANAGED_ENTRYPOINT_SYMBOLS SYMBOLS "..\\bin\\ProfilerResources\\netcoreapp2.0\\OpenTelemetry.AutoInstrumentation.ClrProfiler.Managed.Loader.pdb"
|
||||
NET45_MANAGED_ENTRYPOINT_DLL ASSEMBLY "..\\bin\\ProfilerResources\\net45\\OpenTelemetry.AutoInstrumentation.ClrProfiler.Managed.Loader.dll"
|
||||
NET45_MANAGED_ENTRYPOINT_SYMBOLS SYMBOLS "..\\bin\\ProfilerResources\\net45\\OpenTelemetry.AutoInstrumentation.ClrProfiler.Managed.Loader.pdb"
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
|
@ -48,7 +48,7 @@ CorProfiler::Initialize(IUnknown* cor_profiler_info_unknown) {
|
|||
|
||||
// check if tracing is completely disabled
|
||||
if (IsTracingDisabled()) {
|
||||
Info("DATADOG TRACER DIAGNOSTICS - Profiler disabled in ", environment::tracing_enabled);
|
||||
Info("OpenTelemetry TRACER DIAGNOSTICS - Profiler disabled in ", environment::tracing_enabled);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
@ -60,7 +60,7 @@ CorProfiler::Initialize(IUnknown* cor_profiler_info_unknown) {
|
|||
// process's name is on the list
|
||||
if (!include_process_names.empty() &&
|
||||
!Contains(include_process_names, process_name)) {
|
||||
Info("DATADOG TRACER DIAGNOSTICS - Profiler disabled: ", process_name, " not found in ",
|
||||
Info("OpenTelemetry TRACER DIAGNOSTICS - Profiler disabled: ", process_name, " not found in ",
|
||||
environment::include_process_names, ".");
|
||||
return E_FAIL;
|
||||
}
|
||||
|
@ -70,7 +70,7 @@ CorProfiler::Initialize(IUnknown* cor_profiler_info_unknown) {
|
|||
|
||||
// attach profiler only if this process's name is NOT on the list
|
||||
if (Contains(exclude_process_names, process_name)) {
|
||||
Info("DATADOG TRACER DIAGNOSTICS - Profiler disabled: ", process_name, " found in ",
|
||||
Info("OpenTelemetry TRACER DIAGNOSTICS - Profiler disabled: ", process_name, " found in ",
|
||||
environment::exclude_process_names, ".");
|
||||
return E_FAIL;
|
||||
}
|
||||
|
@ -78,7 +78,7 @@ CorProfiler::Initialize(IUnknown* cor_profiler_info_unknown) {
|
|||
// get Profiler interface
|
||||
HRESULT hr = cor_profiler_info_unknown->QueryInterface(__uuidof(ICorProfilerInfo4), (void**)&this->info_);
|
||||
if (FAILED(hr)) {
|
||||
Warn("DATADOG TRACER DIAGNOSTICS - Failed to attach profiler: interface ICorProfilerInfo4 not found.");
|
||||
Warn("OpenTelemetry TRACER DIAGNOSTICS - Failed to attach profiler: interface ICorProfilerInfo4 not found.");
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
@ -98,7 +98,7 @@ CorProfiler::Initialize(IUnknown* cor_profiler_info_unknown) {
|
|||
GetEnvironmentValue(environment::azure_app_services_app_pool_id);
|
||||
|
||||
if (app_pool_id_value.size() > 1 && app_pool_id_value.at(0) == '~') {
|
||||
Info("DATADOG TRACER DIAGNOSTICS - Profiler disabled: ", environment::azure_app_services_app_pool_id,
|
||||
Info("OpenTelemetry TRACER DIAGNOSTICS - Profiler disabled: ", environment::azure_app_services_app_pool_id,
|
||||
" ", app_pool_id_value,
|
||||
" is recognized as an Azure App Services infrastructure process.");
|
||||
return E_FAIL;
|
||||
|
@ -108,7 +108,7 @@ CorProfiler::Initialize(IUnknown* cor_profiler_info_unknown) {
|
|||
environment::azure_app_services_cli_telemetry_profile_value);
|
||||
|
||||
if (cli_telemetry_profile_value == WStr("AzureKudu")) {
|
||||
Info("DATADOG TRACER DIAGNOSTICS - Profiler disabled: ", app_pool_id_value,
|
||||
Info("OpenTelemetry TRACER DIAGNOSTICS - Profiler disabled: ", app_pool_id_value,
|
||||
" is recognized as Kudu, an Azure App Services reserved process.");
|
||||
return E_FAIL;
|
||||
}
|
||||
|
@ -118,7 +118,7 @@ CorProfiler::Initialize(IUnknown* cor_profiler_info_unknown) {
|
|||
const WSTRING integrations_paths = GetEnvironmentValue(environment::integrations_path);
|
||||
|
||||
if (!IsTracingForced() && integrations_paths.empty()) {
|
||||
Warn("DATADOG TRACER DIAGNOSTICS - Profiler disabled: ", environment::integrations_path,
|
||||
Warn("OpenTelemetry TRACER DIAGNOSTICS - Profiler disabled: ", environment::integrations_path,
|
||||
" environment variable not set.");
|
||||
return E_FAIL;
|
||||
}
|
||||
|
@ -151,7 +151,7 @@ CorProfiler::Initialize(IUnknown* cor_profiler_info_unknown) {
|
|||
|
||||
// check if there are any enabled integrations left
|
||||
if (!IsTracingForced() && integration_methods_.empty()) {
|
||||
Warn("DATADOG TRACER DIAGNOSTICS - Profiler disabled: no enabled integrations found.");
|
||||
Warn("OpenTelemetry TRACER DIAGNOSTICS - Profiler disabled: no enabled integrations found.");
|
||||
return E_FAIL;
|
||||
} else {
|
||||
Debug("Number of Integrations loaded: ", integration_methods_.size());
|
||||
|
@ -223,7 +223,7 @@ CorProfiler::Initialize(IUnknown* cor_profiler_info_unknown) {
|
|||
}
|
||||
}
|
||||
if (FAILED(hr)) {
|
||||
Warn("DATADOG TRACER DIAGNOSTICS - Failed to attach profiler: unable to set event mask.");
|
||||
Warn("OpenTelemetry TRACER DIAGNOSTICS - Failed to attach profiler: unable to set event mask.");
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
@ -403,11 +403,11 @@ HRESULT STDMETHODCALLTYPE CorProfiler::ModuleLoadFinished(ModuleID module_id,
|
|||
}
|
||||
|
||||
// In IIS, the startup hook will be inserted into a method in System.Web (which is domain-neutral)
|
||||
// but the Datadog.Trace.ClrProfiler.Managed.Loader assembly that the startup hook loads from a
|
||||
// but the OpenTelemetry.AutoInstrumentation.ClrProfiler.Managed.Loader assembly that the startup hook loads from a
|
||||
// byte array will be loaded into a non-shared AppDomain.
|
||||
// In this case, do not insert another startup hook into that non-shared AppDomain
|
||||
if (module_info.assembly.name == WStr("Datadog.Trace.ClrProfiler.Managed.Loader")) {
|
||||
Info("ModuleLoadFinished: Datadog.Trace.ClrProfiler.Managed.Loader loaded into AppDomain ", app_domain_id, " ", module_info.assembly.app_domain_name);
|
||||
if (module_info.assembly.name == WStr("OpenTelemetry.AutoInstrumentation.ClrProfiler.Managed.Loader")) {
|
||||
Info("ModuleLoadFinished: OpenTelemetry.AutoInstrumentation.ClrProfiler.Managed.Loader loaded into AppDomain ", app_domain_id, " ", module_info.assembly.app_domain_name);
|
||||
first_jit_compilation_app_domains.insert(app_domain_id);
|
||||
return S_OK;
|
||||
}
|
||||
|
@ -655,7 +655,7 @@ HRESULT STDMETHODCALLTYPE CorProfiler::JITCompilationStarted(
|
|||
|
||||
// IIS: Ensure that the startup hook is inserted into System.Web.Compilation.BuildManager.InvokePreStartInitMethods.
|
||||
// This will be the first call-site considered for the startup hook injection,
|
||||
// which correctly loads Datadog.Trace.ClrProfiler.Managed.Loader into the application's
|
||||
// which correctly loads OpenTelemetry.AutoInstrumentation.ClrProfiler.Managed.Loader into the application's
|
||||
// own AppDomain because at this point in the code path, the ApplicationImpersonationContext
|
||||
// has been started.
|
||||
//
|
||||
|
@ -2116,17 +2116,17 @@ Debug("GenerateVoidILStartupMethod: Linux: Setting the PInvoke native profiler l
|
|||
return hr;
|
||||
}
|
||||
|
||||
// Create a string representing "Datadog.Trace.ClrProfiler.Managed.Loader.Startup"
|
||||
// Create a string representing "OpenTelemetry.AutoInstrumentation.ClrProfiler.Managed.Loader.Startup"
|
||||
// Create OS-specific implementations because on Windows, creating the string via
|
||||
// "Datadog.Trace.ClrProfiler.Managed.Loader.Startup"_W.c_str() does not create the
|
||||
// "OpenTelemetry.AutoInstrumentation.ClrProfiler.Managed.Loader.Startup"_W.c_str() does not create the
|
||||
// proper string for CreateInstance to successfully call
|
||||
#ifdef _WIN32
|
||||
LPCWSTR load_helper_str =
|
||||
L"Datadog.Trace.ClrProfiler.Managed.Loader.Startup";
|
||||
L"OpenTelemetry.AutoInstrumentation.ClrProfiler.Managed.Loader.Startup";
|
||||
auto load_helper_str_size = wcslen(load_helper_str);
|
||||
#else
|
||||
char16_t load_helper_str[] =
|
||||
u"Datadog.Trace.ClrProfiler.Managed.Loader.Startup";
|
||||
u"OpenTelemetry.AutoInstrumentation.ClrProfiler.Managed.Loader.Startup";
|
||||
auto load_helper_str_size = std::char_traits<char16_t>::length(load_helper_str);
|
||||
#endif
|
||||
|
||||
|
@ -2357,7 +2357,7 @@ Debug("GenerateVoidILStartupMethod: Linux: Setting the PInvoke native profiler l
|
|||
pNewInstr->m_Arg8 = 6;
|
||||
rewriter_void.InsertBefore(pFirstInstr, pNewInstr);
|
||||
|
||||
// Step 4) Call instance method Assembly.CreateInstance("Datadog.Trace.ClrProfiler.Managed.Loader.Startup")
|
||||
// Step 4) Call instance method Assembly.CreateInstance("OpenTelemetry.AutoInstrumentation.ClrProfiler.Managed.Loader.Startup")
|
||||
|
||||
// ldloc.s 6 : Load the "loadedAssembly" variable (locals index 6) to call Assembly.CreateInstance
|
||||
pNewInstr = rewriter_void.NewILInstr();
|
||||
|
@ -2365,7 +2365,7 @@ Debug("GenerateVoidILStartupMethod: Linux: Setting the PInvoke native profiler l
|
|||
pNewInstr->m_Arg8 = 6;
|
||||
rewriter_void.InsertBefore(pFirstInstr, pNewInstr);
|
||||
|
||||
// ldstr "Datadog.Trace.ClrProfiler.Managed.Loader.Startup"
|
||||
// ldstr "OpenTelemetry.AutoInstrumentation.ClrProfiler.Managed.Loader.Startup"
|
||||
pNewInstr = rewriter_void.NewILInstr();
|
||||
pNewInstr->m_opcode = CEE_LDSTR;
|
||||
pNewInstr->m_Arg32 = load_helper_token;
|
||||
|
@ -2491,9 +2491,9 @@ HRESULT CorProfiler::AddIISPreStartInitFlags(
|
|||
|
||||
// Define "Datadog_IISPreInitStart" string
|
||||
// Create a string representing
|
||||
// "Datadog.Trace.ClrProfiler.Managed.Loader.Startup" Create OS-specific
|
||||
// "OpenTelemetry.AutoInstrumentation.ClrProfiler.Managed.Loader.Startup" Create OS-specific
|
||||
// implementations because on Windows, creating the string via
|
||||
// "Datadog.Trace.ClrProfiler.Managed.Loader.Startup"_W.c_str() does not
|
||||
// "OpenTelemetry.AutoInstrumentation.ClrProfiler.Managed.Loader.Startup"_W.c_str() does not
|
||||
// create the proper string for CreateInstance to successfully call
|
||||
#ifdef _WIN32
|
||||
LPCWSTR pre_init_start_str = L"Datadog_IISPreInitStart";
|
||||
|
@ -2585,11 +2585,11 @@ HRESULT CorProfiler::AddIISPreStartInitFlags(
|
|||
}
|
||||
|
||||
#ifdef LINUX
|
||||
extern uint8_t dll_start[] asm("_binary_Datadog_Trace_ClrProfiler_Managed_Loader_dll_start");
|
||||
extern uint8_t dll_end[] asm("_binary_Datadog_Trace_ClrProfiler_Managed_Loader_dll_end");
|
||||
extern uint8_t dll_start[] asm("_binary_OpenTelemetry_AutoInstrumentation_ClrProfiler_Managed_Loader_dll_start");
|
||||
extern uint8_t dll_end[] asm("_binary_OpenTelemetry_AutoInstrumentation_ClrProfiler_Managed_Loader_dll_end");
|
||||
|
||||
extern uint8_t pdb_start[] asm("_binary_Datadog_Trace_ClrProfiler_Managed_Loader_pdb_start");
|
||||
extern uint8_t pdb_end[] asm("_binary_Datadog_Trace_ClrProfiler_Managed_Loader_pdb_end");
|
||||
extern uint8_t pdb_start[] asm("_binary_OpenTelemetry_AutoInstrumentation_ClrProfiler_Managed_Loader_pdb_start");
|
||||
extern uint8_t pdb_end[] asm("_binary_OpenTelemetry_AutoInstrumentation_ClrProfiler_Managed_Loader_pdb_end");
|
||||
#endif
|
||||
|
||||
void CorProfiler::GetAssemblyAndSymbolsBytes(BYTE** pAssemblyArray, int* assemblySize, BYTE** pSymbolsArray, int* symbolsSize) const {
|
|
@ -35,7 +35,6 @@ namespace trace {
|
|||
environment::azure_app_services_cli_telemetry_profile_value};
|
||||
|
||||
inline WSTRING skip_assembly_prefixes[]{
|
||||
WStr("Datadog.Trace"),
|
||||
WStr("OpenTelemetry.AutoInstrumentation"),
|
||||
WStr("MessagePack"),
|
||||
WStr("Microsoft.AI"),
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue