From 181c7f81e86804842e7fb7b711f6d1240d6d5ef7 Mon Sep 17 00:00:00 2001 From: Andrii Kurdiumov Date: Tue, 7 Jul 2026 16:44:24 +0200 Subject: [PATCH 1/4] Fix build with disabled event trace/perftracing --- .../nativeaot/Runtime/EventPipeInterface.h | 4 ++- .../nativeaot/Runtime/Full/CMakeLists.txt | 24 ++++++++++----- .../nativeaot/Runtime/disabledeventtrace.cpp | 2 ++ .../Runtime/eventpipe/CMakeLists.txt | 30 +++++++++++-------- .../nativeaot/Runtime/eventpipe/ep-rt-aot.cpp | 7 +++++ src/coreclr/nativeaot/Runtime/eventtrace.h | 6 ++-- src/coreclr/nativeaot/Runtime/gcenv.ee.cpp | 2 +- .../Runtime/windows/CoffNativeCodeManager.cpp | 2 ++ 8 files changed, 52 insertions(+), 25 deletions(-) diff --git a/src/coreclr/nativeaot/Runtime/EventPipeInterface.h b/src/coreclr/nativeaot/Runtime/EventPipeInterface.h index 4ab90aa18efa43..72cdaaa0bba5ad 100644 --- a/src/coreclr/nativeaot/Runtime/EventPipeInterface.h +++ b/src/coreclr/nativeaot/Runtime/EventPipeInterface.h @@ -18,5 +18,7 @@ void EventPipe_ThreadShutdown(); void EventPipe_Shutdown(); bool DiagnosticServer_Shutdown(); +#ifdef FEATURE_EVENT_TRACE void EventTracing_Initialize(); -#endif //EVENTPIPE_INTERFACE_H \ No newline at end of file +#endif // FEATURE_EVENT_TRACE +#endif //EVENTPIPE_INTERFACE_H diff --git a/src/coreclr/nativeaot/Runtime/Full/CMakeLists.txt b/src/coreclr/nativeaot/Runtime/Full/CMakeLists.txt index b55aef8e5b5af4..d9f4c1ba065c86 100644 --- a/src/coreclr/nativeaot/Runtime/Full/CMakeLists.txt +++ b/src/coreclr/nativeaot/Runtime/Full/CMakeLists.txt @@ -81,20 +81,30 @@ if(NATIVEAOT_PRIVATE_LIBUNWIND_SOURCES) endif() add_library(Runtime.WorkstationGC STATIC ${COMMON_RUNTIME_SOURCES} ${FULL_RUNTIME_SOURCES} ${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 ${COMMON_RUNTIME_SOURCES} ${FULL_RUNTIME_SOURCES} ${NATIVEAOT_PRIVATE_LIBUNWIND_OBJECT} ${SERVER_GC_SOURCES} ${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/disabledeventtrace.cpp b/src/coreclr/nativeaot/Runtime/disabledeventtrace.cpp index 8fc59c0b7f6b78..86ba9ed66531d6 100644 --- a/src/coreclr/nativeaot/Runtime/disabledeventtrace.cpp +++ b/src/coreclr/nativeaot/Runtime/disabledeventtrace.cpp @@ -19,7 +19,9 @@ bool IsRuntimeProviderEnabled(uint8_t level, uint64_t keyword) } void ETW::GCLog::FireGcStart(ETW_GC_INFO * pGcInfo) { } +#if FEATURE_EVENT_TRACE void ETW::LoaderLog::ModuleLoad(HANDLE pModule) { } +#endif // FEATURE_EVENT_TRACE BOOL ETW::GCLog::ShouldTrackMovementForEtw() { return FALSE; } void ETW::GCLog::BeginMovedReferences(size_t * pProfilingContext) { } void ETW::GCLog::EndMovedReferences(size_t profilingContext, BOOL fAllowProfApiNotification) { } diff --git a/src/coreclr/nativeaot/Runtime/eventpipe/CMakeLists.txt b/src/coreclr/nativeaot/Runtime/eventpipe/CMakeLists.txt index 0ec681c0b88e19..6b482fbdda94b1 100644 --- a/src/coreclr/nativeaot/Runtime/eventpipe/CMakeLists.txt +++ b/src/coreclr/nativeaot/Runtime/eventpipe/CMakeLists.txt @@ -177,13 +177,15 @@ if (CLR_CMAKE_TARGET_WIN32) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/$/dn-containers.pdb" DESTINATION aotsdk COMPONENT nativeaot) endif() -list(APPEND EVENTPIPE_SOURCES - ${AOT_EVENTPIPE_SHIM_SOURCES} - ${AOT_EVENTPIPE_MANAGED_TO_NATIVE_SOURCES} - ${AOT_EVENTTRACE_SOURCES} - ${GEN_EVENTPIPE_PROVIDER_SOURCES} - ${GEN_EVENTPIPE_PLAT_AGNOSTIC_SOURCES} -) +if(FEATURE_EVENT_TRACE) + list(APPEND EVENTPIPE_SOURCES + ${AOT_EVENTPIPE_SHIM_SOURCES} + ${AOT_EVENTPIPE_MANAGED_TO_NATIVE_SOURCES} + ${AOT_EVENTTRACE_SOURCES} + ${GEN_EVENTPIPE_PROVIDER_SOURCES} + ${GEN_EVENTPIPE_PLAT_AGNOSTIC_SOURCES} + ) +endif() list(APPEND AOT_EVENTPIPE_DISABLED_SOURCES ${NATIVEAOT_RUNTIME_DIR}/DisabledEventPipeInterface.cpp @@ -193,16 +195,20 @@ list(APPEND AOT_EVENTPIPE_DISABLED_SOURCES ${GEN_EVENTPIPE_PLAT_AGNOSTIC_DISABLED_SOURCES} ) -add_library(eventpipe-enabled STATIC ${EVENTPIPE_SOURCES}) +if(FEATURE_EVENT_TRACE) + add_library(eventpipe-enabled STATIC ${EVENTPIPE_SOURCES}) -target_link_libraries(eventpipe-enabled PRIVATE eventpipe-shared-objects dn-containers-no-lto) -add_dependencies(eventpipe-enabled aot_eventing_headers) -if(CLR_CMAKE_TARGET_WIN32) - add_dependencies(eventpipe-enabled aot_etw_headers) + target_link_libraries(eventpipe-enabled PRIVATE eventpipe-shared-objects dn-containers-no-lto) + add_dependencies(eventpipe-enabled aot_eventing_headers) + if(CLR_CMAKE_TARGET_WIN32) + add_dependencies(eventpipe-enabled aot_etw_headers) + endif() endif() add_library(eventpipe-disabled STATIC ${AOT_EVENTPIPE_DISABLED_SOURCES}) add_dependencies(eventpipe-disabled aot_eventing_headers) +if(FEATURE_EVENT_TRACE) install_static_library(eventpipe-enabled aotsdk nativeaot) +endif() install_static_library(eventpipe-disabled aotsdk nativeaot) 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..790eabf47d43d9 100644 --- a/src/coreclr/nativeaot/Runtime/eventtrace.h +++ b/src/coreclr/nativeaot/Runtime/eventtrace.h @@ -175,6 +175,7 @@ namespace ETW static HRESULT ForceGCForDiagnostics(); static void ForceGC(LONGLONG l64ClientSequenceNumber); static void FireGcStart(ETW_GC_INFO * pGcInfo); +#if defined(FEATURE_EVENT_TRACE) static void RootReference( LPVOID pvHandle, Object * pRootedNode, @@ -190,6 +191,7 @@ namespace ETW ULONGLONG cRefs, Object ** rgObjReferenceTargets); static void EndHeapDump(ProfilerWalkHeapContext * profilerWalkHeapContext); +#endif static void BeginMovedReferences(size_t * pProfilingContext); static void MovedReference(BYTE * pbMemBlockStart, BYTE * pbMemBlockEnd, ptrdiff_t cbRelocDistance, size_t profilingContext, BOOL fCompacting, BOOL fAllowProfApiNotification = TRUE); static void EndMovedReferences(size_t profilingContext, BOOL fAllowProfApiNotification = TRUE); @@ -198,8 +200,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/gcenv.ee.cpp b/src/coreclr/nativeaot/Runtime/gcenv.ee.cpp index 6f80a12c85692f..b4f5a72970253f 100644 --- a/src/coreclr/nativeaot/Runtime/gcenv.ee.cpp +++ b/src/coreclr/nativeaot/Runtime/gcenv.ee.cpp @@ -41,9 +41,9 @@ void GCToEEInterface::SuspendEE(SUSPEND_REASON reason) Info.SuspendEE.Reason = reason; Info.SuspendEE.GcCount = (((reason == SUSPEND_FOR_GC) || (reason == SUSPEND_FOR_GC_PREP)) ? (uint32_t)GCHeapUtilities::GetGCHeap()->GetGcCount() : (uint32_t)-1); -#endif // FEATURE_EVENT_TRACE FireEtwGCSuspendEEBegin_V1(Info.SuspendEE.Reason, Info.SuspendEE.GcCount, GetClrInstanceId()); +#endif // FEATURE_EVENT_TRACE GetThreadStore()->LockThreadStore(); GCHeapUtilities::GetGCHeap()->SetGCInProgress(TRUE); 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; } From 6cec01a4155ad56d7621a2d9ef1ad56ddf1acd9b Mon Sep 17 00:00:00 2001 From: Andrii Kurdiumov Date: Tue, 7 Jul 2026 20:18:34 +0200 Subject: [PATCH 2/4] Exclude dependencies --- src/coreclr/nativeaot/Runtime/Full/CMakeLists.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/coreclr/nativeaot/Runtime/Full/CMakeLists.txt b/src/coreclr/nativeaot/Runtime/Full/CMakeLists.txt index 29a122df32e920..9c19a568349f1e 100644 --- a/src/coreclr/nativeaot/Runtime/Full/CMakeLists.txt +++ b/src/coreclr/nativeaot/Runtime/Full/CMakeLists.txt @@ -115,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 @@ -125,7 +127,9 @@ 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}) if(FEATURE_PERFTRACING) From 119856ec1dacf72fd7e1d1106a50f7f894293968 Mon Sep 17 00:00:00 2001 From: Andrii Kurdiumov Date: Sat, 11 Jul 2026 21:33:47 +0200 Subject: [PATCH 3/4] Address PR feedback --- .../nativeaot/Runtime/EventPipeInterface.h | 2 -- .../nativeaot/Runtime/Full/CMakeLists.txt | 4 +-- .../nativeaot/Runtime/disabledeventtrace.cpp | 2 -- .../Runtime/eventpipe/CMakeLists.txt | 30 ++++++++----------- src/coreclr/nativeaot/Runtime/eventtrace.h | 2 -- src/coreclr/nativeaot/Runtime/gcenv.ee.cpp | 2 +- 6 files changed, 15 insertions(+), 27 deletions(-) diff --git a/src/coreclr/nativeaot/Runtime/EventPipeInterface.h b/src/coreclr/nativeaot/Runtime/EventPipeInterface.h index 72cdaaa0bba5ad..4dbd3b207edcd8 100644 --- a/src/coreclr/nativeaot/Runtime/EventPipeInterface.h +++ b/src/coreclr/nativeaot/Runtime/EventPipeInterface.h @@ -18,7 +18,5 @@ void EventPipe_ThreadShutdown(); void EventPipe_Shutdown(); bool DiagnosticServer_Shutdown(); -#ifdef FEATURE_EVENT_TRACE void EventTracing_Initialize(); -#endif // FEATURE_EVENT_TRACE #endif //EVENTPIPE_INTERFACE_H diff --git a/src/coreclr/nativeaot/Runtime/Full/CMakeLists.txt b/src/coreclr/nativeaot/Runtime/Full/CMakeLists.txt index 9c19a568349f1e..9701ad1713381e 100644 --- a/src/coreclr/nativeaot/Runtime/Full/CMakeLists.txt +++ b/src/coreclr/nativeaot/Runtime/Full/CMakeLists.txt @@ -88,13 +88,13 @@ endif() add_library(Runtime.GC.Workstation OBJECT ${GC_WKS_SVR_SOURCES}) if(FEATURE_PERFTRACING) - add_dependencies(Runtime.WorkstationGC aot_eventing_headers) + 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}) if(FEATURE_PERFTRACING) - add_dependencies(Runtime.ServerGC aot_eventing_headers) + 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) diff --git a/src/coreclr/nativeaot/Runtime/disabledeventtrace.cpp b/src/coreclr/nativeaot/Runtime/disabledeventtrace.cpp index 86ba9ed66531d6..8fc59c0b7f6b78 100644 --- a/src/coreclr/nativeaot/Runtime/disabledeventtrace.cpp +++ b/src/coreclr/nativeaot/Runtime/disabledeventtrace.cpp @@ -19,9 +19,7 @@ bool IsRuntimeProviderEnabled(uint8_t level, uint64_t keyword) } void ETW::GCLog::FireGcStart(ETW_GC_INFO * pGcInfo) { } -#if FEATURE_EVENT_TRACE void ETW::LoaderLog::ModuleLoad(HANDLE pModule) { } -#endif // FEATURE_EVENT_TRACE BOOL ETW::GCLog::ShouldTrackMovementForEtw() { return FALSE; } void ETW::GCLog::BeginMovedReferences(size_t * pProfilingContext) { } void ETW::GCLog::EndMovedReferences(size_t profilingContext, BOOL fAllowProfApiNotification) { } diff --git a/src/coreclr/nativeaot/Runtime/eventpipe/CMakeLists.txt b/src/coreclr/nativeaot/Runtime/eventpipe/CMakeLists.txt index 6b482fbdda94b1..0ec681c0b88e19 100644 --- a/src/coreclr/nativeaot/Runtime/eventpipe/CMakeLists.txt +++ b/src/coreclr/nativeaot/Runtime/eventpipe/CMakeLists.txt @@ -177,15 +177,13 @@ if (CLR_CMAKE_TARGET_WIN32) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/$/dn-containers.pdb" DESTINATION aotsdk COMPONENT nativeaot) endif() -if(FEATURE_EVENT_TRACE) - list(APPEND EVENTPIPE_SOURCES - ${AOT_EVENTPIPE_SHIM_SOURCES} - ${AOT_EVENTPIPE_MANAGED_TO_NATIVE_SOURCES} - ${AOT_EVENTTRACE_SOURCES} - ${GEN_EVENTPIPE_PROVIDER_SOURCES} - ${GEN_EVENTPIPE_PLAT_AGNOSTIC_SOURCES} - ) -endif() +list(APPEND EVENTPIPE_SOURCES + ${AOT_EVENTPIPE_SHIM_SOURCES} + ${AOT_EVENTPIPE_MANAGED_TO_NATIVE_SOURCES} + ${AOT_EVENTTRACE_SOURCES} + ${GEN_EVENTPIPE_PROVIDER_SOURCES} + ${GEN_EVENTPIPE_PLAT_AGNOSTIC_SOURCES} +) list(APPEND AOT_EVENTPIPE_DISABLED_SOURCES ${NATIVEAOT_RUNTIME_DIR}/DisabledEventPipeInterface.cpp @@ -195,20 +193,16 @@ list(APPEND AOT_EVENTPIPE_DISABLED_SOURCES ${GEN_EVENTPIPE_PLAT_AGNOSTIC_DISABLED_SOURCES} ) -if(FEATURE_EVENT_TRACE) - add_library(eventpipe-enabled STATIC ${EVENTPIPE_SOURCES}) +add_library(eventpipe-enabled STATIC ${EVENTPIPE_SOURCES}) - target_link_libraries(eventpipe-enabled PRIVATE eventpipe-shared-objects dn-containers-no-lto) - add_dependencies(eventpipe-enabled aot_eventing_headers) - if(CLR_CMAKE_TARGET_WIN32) - add_dependencies(eventpipe-enabled aot_etw_headers) - endif() +target_link_libraries(eventpipe-enabled PRIVATE eventpipe-shared-objects dn-containers-no-lto) +add_dependencies(eventpipe-enabled aot_eventing_headers) +if(CLR_CMAKE_TARGET_WIN32) + add_dependencies(eventpipe-enabled aot_etw_headers) endif() add_library(eventpipe-disabled STATIC ${AOT_EVENTPIPE_DISABLED_SOURCES}) add_dependencies(eventpipe-disabled aot_eventing_headers) -if(FEATURE_EVENT_TRACE) install_static_library(eventpipe-enabled aotsdk nativeaot) -endif() install_static_library(eventpipe-disabled aotsdk nativeaot) diff --git a/src/coreclr/nativeaot/Runtime/eventtrace.h b/src/coreclr/nativeaot/Runtime/eventtrace.h index 790eabf47d43d9..a240290db064ce 100644 --- a/src/coreclr/nativeaot/Runtime/eventtrace.h +++ b/src/coreclr/nativeaot/Runtime/eventtrace.h @@ -175,7 +175,6 @@ namespace ETW static HRESULT ForceGCForDiagnostics(); static void ForceGC(LONGLONG l64ClientSequenceNumber); static void FireGcStart(ETW_GC_INFO * pGcInfo); -#if defined(FEATURE_EVENT_TRACE) static void RootReference( LPVOID pvHandle, Object * pRootedNode, @@ -191,7 +190,6 @@ namespace ETW ULONGLONG cRefs, Object ** rgObjReferenceTargets); static void EndHeapDump(ProfilerWalkHeapContext * profilerWalkHeapContext); -#endif static void BeginMovedReferences(size_t * pProfilingContext); static void MovedReference(BYTE * pbMemBlockStart, BYTE * pbMemBlockEnd, ptrdiff_t cbRelocDistance, size_t profilingContext, BOOL fCompacting, BOOL fAllowProfApiNotification = TRUE); static void EndMovedReferences(size_t profilingContext, BOOL fAllowProfApiNotification = TRUE); diff --git a/src/coreclr/nativeaot/Runtime/gcenv.ee.cpp b/src/coreclr/nativeaot/Runtime/gcenv.ee.cpp index b4f5a72970253f..6f80a12c85692f 100644 --- a/src/coreclr/nativeaot/Runtime/gcenv.ee.cpp +++ b/src/coreclr/nativeaot/Runtime/gcenv.ee.cpp @@ -41,9 +41,9 @@ void GCToEEInterface::SuspendEE(SUSPEND_REASON reason) Info.SuspendEE.Reason = reason; Info.SuspendEE.GcCount = (((reason == SUSPEND_FOR_GC) || (reason == SUSPEND_FOR_GC_PREP)) ? (uint32_t)GCHeapUtilities::GetGCHeap()->GetGcCount() : (uint32_t)-1); +#endif // FEATURE_EVENT_TRACE FireEtwGCSuspendEEBegin_V1(Info.SuspendEE.Reason, Info.SuspendEE.GcCount, GetClrInstanceId()); -#endif // FEATURE_EVENT_TRACE GetThreadStore()->LockThreadStore(); GCHeapUtilities::GetGCHeap()->SetGCInProgress(TRUE); From ba87619890c0b7d85307d9a813d30b0589544c3a Mon Sep 17 00:00:00 2001 From: Andrii Kurdiumov Date: Sat, 11 Jul 2026 21:55:22 +0200 Subject: [PATCH 4/4] Remove line endings which trigger unnescessary change in diff. --- src/coreclr/nativeaot/Runtime/EventPipeInterface.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/coreclr/nativeaot/Runtime/EventPipeInterface.h b/src/coreclr/nativeaot/Runtime/EventPipeInterface.h index 4dbd3b207edcd8..4ab90aa18efa43 100644 --- a/src/coreclr/nativeaot/Runtime/EventPipeInterface.h +++ b/src/coreclr/nativeaot/Runtime/EventPipeInterface.h @@ -19,4 +19,4 @@ void EventPipe_Shutdown(); bool DiagnosticServer_Shutdown(); void EventTracing_Initialize(); -#endif //EVENTPIPE_INTERFACE_H +#endif //EVENTPIPE_INTERFACE_H \ No newline at end of file