Skip to content

Commit

Permalink
Revert "Add proper spdlog-based logging to NativeLoader (#2481)" (#2485)
Browse files Browse the repository at this point in the history
This reverts commit 08d734e.
Just temporarily, as we are about to release and want more testing of this first
  • Loading branch information
andrewlock authored Feb 22, 2022
1 parent 08d734e commit 4fdd8a8
Show file tree
Hide file tree
Showing 19 changed files with 178 additions and 280 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ elseif (CMAKE_SYSTEM_NAME MATCHES "Darwin")
SET(ISMACOS true)
endif()

SET(DOTNET_TRACER_REPO_ROOT_PATH ${CMAKE_SOURCE_DIR}/../../../)

# Detect bitness of the build
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
message(STATUS "Setting compilation for 64bits processor")
Expand Down Expand Up @@ -92,27 +90,6 @@ SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${OUTPUT_BIN_DIR})
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${OUTPUT_BIN_DIR})
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${OUTPUT_BIN_DIR})

# ******************************************************
# Prepare dependecies
# ******************************************************

include(ExternalProject)
set(EXTERNAL_INSTALL_LOCATION ${OUTPUT_DEPS_DIR}/fmt/)
ExternalProject_Add(fmt
GIT_REPOSITORY https://github.com/DataDog/fmt.git
GIT_TAG 5.3.0
GIT_CONFIG advice.detachedHead=false
TIMEOUT 5
CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
PREFIX "${EXTERNAL_INSTALL_LOCATION}"
CONFIGURE_COMMAND "" # Disable configure step
BUILD_COMMAND "" # Disable build step
INSTALL_COMMAND "" # Disable install step
UPDATE_COMMAND "" # Disable update step: clones the project only once
)
ExternalProject_Get_Property(fmt source_dir)
set(fmt_INCLUDE_DIR ${source_dir}/include)

# ******************************************************
# Compiler options
# ******************************************************
Expand Down Expand Up @@ -172,10 +149,8 @@ add_library("Datadog.AutoInstrumentation.NativeLoader" SHARED
dynamic_instance.cpp
miniutf.cpp
pal.cpp
string_utils.cpp
string.cpp
../Datadog.Trace.ClrProfiler.Native/lib/coreclr/src/pal/prebuilt/idl/corprof_i.cpp
../../../shared/src/native-src/string.cpp
../../../shared/src/native-src/util.cpp
${GENERATED_OBJ_FILES}
)

Expand All @@ -187,8 +162,6 @@ target_include_directories("Datadog.AutoInstrumentation.NativeLoader"
PUBLIC ../Datadog.Trace.ClrProfiler.Native/lib/coreclr/src/pal/prebuilt/inc
PUBLIC ../Datadog.Trace.ClrProfiler.Native/lib/coreclr/src/pal/inc
PUBLIC ../Datadog.Trace.ClrProfiler.Native/lib/coreclr/src/inc
PUBLIC ${DOTNET_TRACER_REPO_ROOT_PATH}/shared/src/native-lib/spdlog/include
PUBLIC ${fmt_INCLUDE_DIR}/
)

# Define linker libraries
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,6 @@
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
<LIB_PATH>..\..\src\Datadog.Trace.ClrProfiler.Native\lib\</LIB_PATH>
<LIB_INCLUDES>$(LIB_PATH)coreclr\src\pal\prebuilt\inc</LIB_INCLUDES>
<DOTNET-TRACER-REPO-ROOT-PATH>..\..\..\</DOTNET-TRACER-REPO-ROOT-PATH>
<SHARED-LIB-PATH>$(DOTNET-TRACER-REPO-ROOT-PATH)shared/src/native-lib/</SHARED-LIB-PATH>
<SHARED-LIB-PLATFORM Condition="'$(Platform)'=='x64'">x64</SHARED-LIB-PLATFORM>
<SHARED-LIB-PLATFORM Condition="'$(Platform)'=='Win32' OR '$(Platform)'=='x86'">x86</SHARED-LIB-PLATFORM>
<SHARED-LIB-INCLUDES>$(SHARED-LIB-PATH)fmt_$(SHARED-LIB-PLATFORM)-windows-static\include;$(SHARED-LIB-PATH)spdlog\include</SHARED-LIB-INCLUDES>
<SHARED-LIB-BINARIES Condition="'$(Configuration)'=='Release'">$(SHARED-LIB-PATH)fmt_$(SHARED-LIB-PLATFORM)-windows-static\lib\fmt.lib</SHARED-LIB-BINARIES>
<SHARED-LIB-BINARIES Condition="'$(Configuration)'=='Debug'">$(SHARED-LIB-PATH)fmt_$(SHARED-LIB-PLATFORM)-windows-static\debug\lib\fmtd.lib</SHARED-LIB-BINARIES>

</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
Expand Down Expand Up @@ -112,18 +104,17 @@
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>SPDLOG_COMPILED_LIB;SPDLOG_FMT_EXTERNAL;WIN32;X86;BIT86;_DEBUG;DATADOGNATIVELOADER_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;X86;BIT86;_DEBUG;DATADOGNATIVELOADER_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<LanguageStandard>stdcpp17</LanguageStandard>
<AdditionalIncludeDirectories>$(LIB_INCLUDES);$(SHARED-LIB-INCLUDES);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(LIB_INCLUDES);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ModuleDefinitionFile>.\Datadog.AutoInstrumentation.NativeLoader.def</ModuleDefinitionFile>
<EnableUAC>false</EnableUAC>
<AdditionalDependencies>$(SHARED-LIB-BINARIES);%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
Expand All @@ -138,11 +129,11 @@
<IntrinsicFunctions>true</IntrinsicFunctions>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<OmitFramePointers>true</OmitFramePointers>
<PreprocessorDefinitions>SPDLOG_COMPILED_LIB;SPDLOG_FMT_EXTERNAL;WIN32;X86;BIT86;NDEBUG;DATADOGNATIVELOADER_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;X86;BIT86;NDEBUG;DATADOGNATIVELOADER_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpp17</LanguageStandard>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<AdditionalIncludeDirectories>$(LIB_INCLUDES);$(SHARED-LIB-INCLUDES);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(LIB_INCLUDES);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
Expand All @@ -151,7 +142,6 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
<ModuleDefinitionFile>.\Datadog.AutoInstrumentation.NativeLoader.def</ModuleDefinitionFile>
<EnableUAC>false</EnableUAC>
<AdditionalDependencies>$(SHARED-LIB-BINARIES);%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
Expand All @@ -163,15 +153,14 @@
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpp17</LanguageStandard>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>SPDLOG_COMPILED_LIB;SPDLOG_FMT_EXTERNAL;BIT64;AMD64;_DEBUG;DATADOGNATIVELOADER_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SHARED-LIB-INCLUDES);$(LIB_INCLUDES);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>BIT64;AMD64;_DEBUG;DATADOGNATIVELOADER_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(LIB_INCLUDES);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ModuleDefinitionFile>.\Datadog.AutoInstrumentation.NativeLoader.def</ModuleDefinitionFile>
<EnableUAC>false</EnableUAC>
<AdditionalDependencies>$(SHARED-LIB-BINARIES);%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
Expand All @@ -187,9 +176,9 @@
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpp17</LanguageStandard>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<AdditionalIncludeDirectories>$(LIB_INCLUDES);$(SHARED-LIB-INCLUDES);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(LIB_INCLUDES);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>SPDLOG_COMPILED_LIB;SPDLOG_FMT_EXTERNAL;BIT64;AMD64;NDEBUG;DATADOGNATIVELOADER_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>BIT64;AMD64;NDEBUG;DATADOGNATIVELOADER_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
Expand All @@ -198,34 +187,30 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
<ModuleDefinitionFile>.\Datadog.AutoInstrumentation.NativeLoader.def</ModuleDefinitionFile>
<EnableUAC>false</EnableUAC>
<AdditionalDependencies>$(SHARED-LIB-BINARIES);%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="cor_profiler_class_factory.h" />
<ClInclude Include="cor_profiler.h" />
<ClInclude Include="dynamic_instance.h" />
<ClInclude Include="dynamic_dispatcher.h" />
<ClInclude Include="EnvironmentVariables.h" />
<ClInclude Include="guid.h" />
<ClInclude Include="log.h" />
<ClInclude Include="logging.h" />
<ClInclude Include="miniutf.hpp" />
<ClInclude Include="miniutfdata.h" />
<ClInclude Include="pal.h" />
<ClInclude Include="string_utils.h" />
<ClInclude Include="string.h" />
<ClInclude Include="util.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\shared\src\native-src\string.cpp" />
<ClCompile Include="..\..\..\shared\src\native-src\util.cpp" />
<ClCompile Include="cor_profiler_class_factory.cpp" />
<ClCompile Include="cor_profiler.cpp" />
<ClCompile Include="dllmain.cpp" />
<ClCompile Include="dynamic_instance.cpp" />
<ClCompile Include="dynamic_dispatcher.cpp" />
<ClCompile Include="miniutf.cpp" />
<ClCompile Include="pal.cpp" />
<ClCompile Include="string_utils.cpp" />
<ClCompile Include="string.cpp" />
</ItemGroup>
<ItemGroup>
<None Include="Datadog.AutoInstrumentation.NativeLoader.def" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@
<ClInclude Include="cor_profiler.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="log.h">
<ClInclude Include="logging.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="string.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="miniutf.hpp">
Expand All @@ -45,12 +48,6 @@
<ClInclude Include="dynamic_instance.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="EnvironmentVariables.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="string_utils.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="dllmain.cpp">
Expand All @@ -62,6 +59,9 @@
<ClCompile Include="cor_profiler.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="string.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="miniutf.cpp">
<Filter>Source Files</Filter>
</ClCompile>
Expand All @@ -74,18 +74,6 @@
<ClCompile Include="dynamic_instance.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="lib\spdlog\src\spdlog.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\shared\src\native-src\string.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\shared\src\native-src\util.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="string_utils.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<CopyFileToFolders Include="loader.conf" />
Expand Down

This file was deleted.

Loading

0 comments on commit 4fdd8a8

Please sign in to comment.