Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 23 additions & 9 deletions src/coreclr/nativeaot/Runtime/Full/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -111,7 +115,9 @@ add_library(Runtime.WorkstationGC STATIC
${NATIVEAOT_PRIVATE_LIBUNWIND_OBJECT}
${RUNTIME_ARCH_ASM_OBJECTS}
$<TARGET_OBJECTS:Runtime.GC.Workstation>)
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
Expand All @@ -121,15 +127,23 @@ add_library(Runtime.ServerGC STATIC
${RUNTIME_ARCH_ASM_OBJECTS}
$<TARGET_OBJECTS:Runtime.GC.Workstation>
$<TARGET_OBJECTS:Runtime.GC.Server>)
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)
Expand Down
7 changes: 7 additions & 0 deletions src/coreclr/nativeaot/Runtime/eventpipe/ep-rt-aot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 *
Expand Down
4 changes: 0 additions & 4 deletions src/coreclr/nativeaot/Runtime/eventtrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,4 @@ namespace ETW
};
};

#ifndef FEATURE_EVENT_TRACE

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is also interesting thing. This looks like implemented in the disabledeventtrace.cpp or if I guess incorrectly, then it should be removed from both implementations eventtrace.cpp and disabledeventtrace.cpp

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yep, this looks unnecessary. The inline prevents this from being a duplicate symbol error, but looks duplicated.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

actually either by order of inclusion, or by something else, inline does not prevent it from being build error for me. that's how I discover this.

inline void ETW::GCLog::FireGcStart(ETW_GC_INFO * pGcInfo) { }
#endif

#endif //_VMEVENTTRACE_H_
Original file line number Diff line number Diff line change
Expand Up @@ -1190,7 +1190,9 @@ bool RhRegisterOSModule(void * pModule,

pCoffNativeCodeManager.SuppressRelease();

#ifdef FEATURE_EVENT_TRACE
ETW::LoaderLog::ModuleLoad(pModule);
#endif // FEATURE_EVENT_TRACE

return true;
}
Loading