diff --git a/src/coreclr/nativeaot/Runtime/Full/CMakeLists.txt b/src/coreclr/nativeaot/Runtime/Full/CMakeLists.txt index 70c7d7e5c3f1e9..9701ad1713381e 100644 --- a/src/coreclr/nativeaot/Runtime/Full/CMakeLists.txt +++ b/src/coreclr/nativeaot/Runtime/Full/CMakeLists.txt @@ -87,11 +87,15 @@ if(NATIVEAOT_PRIVATE_LIBUNWIND_SOURCES) endif() add_library(Runtime.GC.Workstation OBJECT ${GC_WKS_SVR_SOURCES}) -add_dependencies(Runtime.GC.Workstation aot_eventing_headers) +if(FEATURE_PERFTRACING) + add_dependencies(Runtime.GC.Workstation aot_eventing_headers) +endif() set_target_properties(Runtime.GC.Workstation PROPERTIES UNITY_BUILD ON UNITY_BUILD_BATCH_SIZE 0) add_library(Runtime.GC.Server OBJECT ${GC_WKS_SVR_SOURCES}) -add_dependencies(Runtime.GC.Server aot_eventing_headers) +if(FEATURE_PERFTRACING) + add_dependencies(Runtime.GC.Server aot_eventing_headers) +endif() target_compile_definitions(Runtime.GC.Server PRIVATE FEATURE_SVR_GC SERVER_GC) set_target_properties(Runtime.GC.Server PROPERTIES UNITY_BUILD ON UNITY_BUILD_BATCH_SIZE 0) @@ -111,7 +115,9 @@ add_library(Runtime.WorkstationGC STATIC ${NATIVEAOT_PRIVATE_LIBUNWIND_OBJECT} ${RUNTIME_ARCH_ASM_OBJECTS} $) -add_dependencies(Runtime.WorkstationGC aot_eventing_headers) +if(FEATURE_PERFTRACING) + add_dependencies(Runtime.WorkstationGC aot_eventing_headers) +endif() target_link_libraries(Runtime.WorkstationGC PRIVATE aotminipal nativeaot_cdac_contract_descriptor nativeaot_gc_wks_descriptor) add_library(Runtime.ServerGC STATIC @@ -121,15 +127,23 @@ add_library(Runtime.ServerGC STATIC ${RUNTIME_ARCH_ASM_OBJECTS} $ $) -add_dependencies(Runtime.ServerGC aot_eventing_headers) +if(FEATURE_PERFTRACING) + add_dependencies(Runtime.ServerGC aot_eventing_headers) +endif() target_link_libraries(Runtime.ServerGC PRIVATE aotminipal nativeaot_cdac_contract_descriptor nativeaot_gc_wks_descriptor nativeaot_gc_svr_descriptor) add_library(standalonegc-disabled STATIC ${STANDALONEGC_DISABLED_SOURCES}) -add_dependencies(standalonegc-disabled aot_eventing_headers) +if(FEATURE_PERFTRACING) + add_dependencies(standalonegc-disabled aot_eventing_headers) +endif() add_library(standalonegc-enabled STATIC ${STANDALONEGC_ENABLED_SOURCES}) -add_dependencies(standalonegc-enabled aot_eventing_headers) -if(CLR_CMAKE_TARGET_WIN32) - add_dependencies(standalonegc-disabled aot_etw_headers) - add_dependencies(standalonegc-enabled aot_etw_headers) +if(FEATURE_PERFTRACING) + add_dependencies(standalonegc-enabled aot_eventing_headers) +endif() +if(FEATURE_EVENT_TRACE) + if(CLR_CMAKE_TARGET_WIN32) + add_dependencies(standalonegc-disabled aot_etw_headers) + add_dependencies(standalonegc-enabled aot_etw_headers) + endif() endif() if (CLR_CMAKE_TARGET_ARCH_ARM64 OR CLR_CMAKE_TARGET_ARCH_AMD64) diff --git a/src/coreclr/nativeaot/Runtime/eventpipe/ep-rt-aot.cpp b/src/coreclr/nativeaot/Runtime/eventpipe/ep-rt-aot.cpp index 5e8c8c0e258ed1..cef580c3d12975 100644 --- a/src/coreclr/nativeaot/Runtime/eventpipe/ep-rt-aot.cpp +++ b/src/coreclr/nativeaot/Runtime/eventpipe/ep-rt-aot.cpp @@ -76,20 +76,25 @@ ep_rt_aot_walk_managed_stack_for_thread ( bool ep_rt_aot_providers_validate_all_disabled (void) { +#if FEATURE_EVENT_TRACE return !MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context.EventPipeProvider.IsEnabled && !MICROSOFT_WINDOWS_DOTNETRUNTIME_PRIVATE_PROVIDER_DOTNET_Context.EventPipeProvider.IsEnabled && !MICROSOFT_WINDOWS_DOTNETRUNTIME_RUNDOWN_PROVIDER_DOTNET_Context.EventPipeProvider.IsEnabled; +#endif // FEATURE_EVENT_TRACE + return true; } void ep_rt_aot_provider_config_init ( EventPipeProviderConfiguration *provider_config) { +#if FEATURE_EVENT_TRACE if (!ep_rt_utf8_string_compare (ep_config_get_rundown_provider_name_utf8 (), ep_provider_config_get_provider_name (provider_config))) { MICROSOFT_WINDOWS_DOTNETRUNTIME_RUNDOWN_PROVIDER_DOTNET_Context.EventPipeProvider.Level = (uint8_t) ep_provider_config_get_logging_level (provider_config); MICROSOFT_WINDOWS_DOTNETRUNTIME_RUNDOWN_PROVIDER_DOTNET_Context.EventPipeProvider.EnabledKeywordsBitmask = ep_provider_config_get_keywords (provider_config); MICROSOFT_WINDOWS_DOTNETRUNTIME_RUNDOWN_PROVIDER_DOTNET_Context.EventPipeProvider.IsEnabled = true; } +#endif // FEATURE_EVENT_TRACE } void @@ -213,7 +218,9 @@ ep_rt_aot_entrypoint_assembly_name_get_utf8 (void) void ep_rt_aot_execute_rundown (dn_vector_ptr_t* execution_checkpoints) { +#if FEATURE_EVENT_TRACE ETW::EnumerationLog::EndRundown(); +#endif // FEATURE_EVENT_TRACE } const ep_char8_t * diff --git a/src/coreclr/nativeaot/Runtime/eventtrace.h b/src/coreclr/nativeaot/Runtime/eventtrace.h index f4dd280d89cfa2..a240290db064ce 100644 --- a/src/coreclr/nativeaot/Runtime/eventtrace.h +++ b/src/coreclr/nativeaot/Runtime/eventtrace.h @@ -198,8 +198,4 @@ namespace ETW }; }; -#ifndef FEATURE_EVENT_TRACE -inline void ETW::GCLog::FireGcStart(ETW_GC_INFO * pGcInfo) { } -#endif - #endif //_VMEVENTTRACE_H_ diff --git a/src/coreclr/nativeaot/Runtime/windows/CoffNativeCodeManager.cpp b/src/coreclr/nativeaot/Runtime/windows/CoffNativeCodeManager.cpp index d6f7e224a5adf7..26c475c771d01a 100644 --- a/src/coreclr/nativeaot/Runtime/windows/CoffNativeCodeManager.cpp +++ b/src/coreclr/nativeaot/Runtime/windows/CoffNativeCodeManager.cpp @@ -1190,7 +1190,9 @@ bool RhRegisterOSModule(void * pModule, pCoffNativeCodeManager.SuppressRelease(); +#ifdef FEATURE_EVENT_TRACE ETW::LoaderLog::ModuleLoad(pModule); +#endif // FEATURE_EVENT_TRACE return true; }