From 7b26bfb5b3e7f088aa080b17dbfedee8b64158da Mon Sep 17 00:00:00 2001 From: Elinor Fung Date: Tue, 8 Aug 2023 18:42:37 -0700 Subject: [PATCH] Remove some unnecessary indirection to DiagnosticServerAdapter/EventPipeAdapter in nativeaot (#90132) --- src/coreclr/nativeaot/Runtime/CommonMacros.h | 2 + .../Runtime/DisabledEventPipeInterface.cpp | 12 ++-- .../Runtime/EnabledEventPipeInterface.cpp | 17 ++--- src/coreclr/nativeaot/Runtime/EventPipeInterface.h | 13 ++-- src/coreclr/nativeaot/Runtime/PalRedhawk.h | 4 ++ src/coreclr/nativeaot/Runtime/StackFrameIterator.h | 6 ++ .../nativeaot/Runtime/diagnosticserveradapter.h | 42 ------------ .../Runtime/disabledeventpipeinternal.cpp | 19 +++-- .../Runtime/disabledruntimeeventinternal.cpp | 6 +- .../nativeaot/Runtime/eventpipe/CMakeLists.txt | 1 - .../nativeaot/Runtime/eventpipe/dotnetruntime.cpp | 10 +-- src/coreclr/nativeaot/Runtime/eventpipeadapter.h | 80 +--------------------- .../nativeaot/Runtime/eventpipeinternal.cpp | 34 ++++----- src/coreclr/nativeaot/Runtime/gcenv.h | 5 ++ src/coreclr/nativeaot/Runtime/inc/TargetPtrs.h | 6 -- src/coreclr/nativeaot/Runtime/inc/rhbinder.h | 1 + src/coreclr/nativeaot/Runtime/regdisplay.h | 2 + .../nativeaot/Runtime/runtimeeventinternal.cpp | 4 +- src/coreclr/nativeaot/Runtime/startup.cpp | 14 ++-- src/coreclr/nativeaot/Runtime/thread.h | 4 +- 20 files changed, 89 insertions(+), 193 deletions(-) delete mode 100644 src/coreclr/nativeaot/Runtime/diagnosticserveradapter.h diff --git a/src/coreclr/nativeaot/Runtime/CommonMacros.h b/src/coreclr/nativeaot/Runtime/CommonMacros.h index 8eb58f7..b6d96af 100644 --- a/src/coreclr/nativeaot/Runtime/CommonMacros.h +++ b/src/coreclr/nativeaot/Runtime/CommonMacros.h @@ -64,6 +64,8 @@ #ifndef __GCENV_BASE_INCLUDED__ +#include + // // This macro returns val rounded up as necessary to be a multiple of alignment; alignment must be a power of 2 // diff --git a/src/coreclr/nativeaot/Runtime/DisabledEventPipeInterface.cpp b/src/coreclr/nativeaot/Runtime/DisabledEventPipeInterface.cpp index 1195c7a..e1227c6 100644 --- a/src/coreclr/nativeaot/Runtime/DisabledEventPipeInterface.cpp +++ b/src/coreclr/nativeaot/Runtime/DisabledEventPipeInterface.cpp @@ -1,14 +1,14 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -void EventPipeAdapter_Initialize() {} +void EventPipe_Initialize() {} -bool DiagnosticServerAdapter_Initialize() { return false; } -void DiagnosticServerAdapter_PauseForDiagnosticsMonitor() {} +bool DiagnosticServer_Initialize() { return false; } +void DiagnosticServer_PauseForDiagnosticsMonitor() {} -void EventPipeAdapter_FinishInitialize() {} +void EventPipe_FinishInitialize() {} void EventPipe_ThreadShutdown() { } -void EventPipeAdapter_Shutdown() {} -bool DiagnosticServerAdapter_Shutdown() { return false; } +void EventPipe_Shutdown() {} +bool DiagnosticServer_Shutdown() { return false; } diff --git a/src/coreclr/nativeaot/Runtime/EnabledEventPipeInterface.cpp b/src/coreclr/nativeaot/Runtime/EnabledEventPipeInterface.cpp index 0a68a15..49fdefd 100644 --- a/src/coreclr/nativeaot/Runtime/EnabledEventPipeInterface.cpp +++ b/src/coreclr/nativeaot/Runtime/EnabledEventPipeInterface.cpp @@ -1,17 +1,18 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -#include "eventpipeadapter.h" -#include "diagnosticserveradapter.h" +#include +#include +#include -void EventPipeAdapter_Initialize() { EventPipeAdapter::Initialize(); } +void EventPipe_Initialize() { ep_init(); } -bool DiagnosticServerAdapter_Initialize() { return DiagnosticServerAdapter::Initialize(); } -void DiagnosticServerAdapter_PauseForDiagnosticsMonitor() { DiagnosticServerAdapter::PauseForDiagnosticsMonitor();} +bool DiagnosticServer_Initialize() { return ds_server_init(); } +void DiagnosticServer_PauseForDiagnosticsMonitor() { ds_server_pause_for_diagnostics_monitor(); } -void EventPipeAdapter_FinishInitialize() { EventPipeAdapter::FinishInitialize(); } +void EventPipe_FinishInitialize() { ep_finish_init(); } void EventPipe_ThreadShutdown() { ep_rt_aot_thread_exited(); } -void EventPipeAdapter_Shutdown() { EventPipeAdapter::Shutdown(); } -bool DiagnosticServerAdapter_Shutdown() { return DiagnosticServerAdapter::Shutdown(); } +void EventPipe_Shutdown() { ep_shutdown(); } +bool DiagnosticServer_Shutdown() { return ds_server_shutdown(); } diff --git a/src/coreclr/nativeaot/Runtime/EventPipeInterface.h b/src/coreclr/nativeaot/Runtime/EventPipeInterface.h index c8f2d31..4ab90aa 100644 --- a/src/coreclr/nativeaot/Runtime/EventPipeInterface.h +++ b/src/coreclr/nativeaot/Runtime/EventPipeInterface.h @@ -5,19 +5,18 @@ #define EVENTPIPE_INTERFACE_H // Initialize EventPipe -void EventPipeAdapter_Initialize(); +void EventPipe_Initialize(); // Initialize DS -bool DiagnosticServerAdapter_Initialize(); -void DiagnosticServerAdapter_PauseForDiagnosticsMonitor(); +bool DiagnosticServer_Initialize(); +void DiagnosticServer_PauseForDiagnosticsMonitor(); - -void EventPipeAdapter_FinishInitialize(); +void EventPipe_FinishInitialize(); void EventPipe_ThreadShutdown(); -void EventPipeAdapter_Shutdown(); -bool DiagnosticServerAdapter_Shutdown(); +void EventPipe_Shutdown(); +bool DiagnosticServer_Shutdown(); void EventTracing_Initialize(); #endif //EVENTPIPE_INTERFACE_H \ No newline at end of file diff --git a/src/coreclr/nativeaot/Runtime/PalRedhawk.h b/src/coreclr/nativeaot/Runtime/PalRedhawk.h index f12aa2e..d15969e 100644 --- a/src/coreclr/nativeaot/Runtime/PalRedhawk.h +++ b/src/coreclr/nativeaot/Runtime/PalRedhawk.h @@ -17,6 +17,10 @@ #include #include +#ifdef TARGET_UNIX +#include +#endif + #include "CommonTypes.h" #include "CommonMacros.h" #include "gcenv.structs.h" // CRITICAL_SECTION diff --git a/src/coreclr/nativeaot/Runtime/StackFrameIterator.h b/src/coreclr/nativeaot/Runtime/StackFrameIterator.h index 5ea7676..007ca41 100644 --- a/src/coreclr/nativeaot/Runtime/StackFrameIterator.h +++ b/src/coreclr/nativeaot/Runtime/StackFrameIterator.h @@ -4,7 +4,12 @@ #ifndef __StackFrameIterator_h__ #define __StackFrameIterator_h__ +#include "CommonMacros.h" #include "ICodeManager.h" +#include "PalRedhawk.h" // NATIVE_CONTEXT +#include "regdisplay.h" + +#include "forward_declarations.h" struct ExInfo; typedef DPTR(ExInfo) PTR_ExInfo; @@ -22,6 +27,7 @@ struct EHEnum EHEnumState m_state; }; +class StackFrameIterator; EXTERN_C FC_BOOL_RET FASTCALL RhpSfiInit(StackFrameIterator* pThis, PAL_LIMITED_CONTEXT* pStackwalkCtx, CLR_BOOL instructionFault); EXTERN_C FC_BOOL_RET FASTCALL RhpSfiNext(StackFrameIterator* pThis, uint32_t* puExCollideClauseIdx, CLR_BOOL* pfUnwoundReversePInvoke); diff --git a/src/coreclr/nativeaot/Runtime/diagnosticserveradapter.h b/src/coreclr/nativeaot/Runtime/diagnosticserveradapter.h deleted file mode 100644 index 7a133ce..0000000 --- a/src/coreclr/nativeaot/Runtime/diagnosticserveradapter.h +++ /dev/null @@ -1,42 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -#ifndef DIAGNOSTIC_SERVER_ADAPTER_H -#define DIAGNOSTIC_SERVER_ADAPTER_H - -#if defined(FEATURE_PERFTRACING) - -#include - -class DiagnosticServerAdapter final -{ -public: - static inline bool Initialize() - { - return ds_server_init(); - } - - static inline bool Shutdown() - { - return ds_server_shutdown(); - } - - NOINLINE static void PauseForDiagnosticsMonitor() - { - return ds_server_pause_for_diagnostics_monitor(); - } - - static void ResumeRuntimeStartup() - { - return ds_server_resume_runtime_startup(); - } - - static bool IsPausedInRuntimeStartup() - { - return ds_server_is_paused_in_startup(); - } -}; - -#endif // FEATURE_PERFTRACING - -#endif // DIAGNOSTIC_SERVER_ADAPTER_H diff --git a/src/coreclr/nativeaot/Runtime/disabledeventpipeinternal.cpp b/src/coreclr/nativeaot/Runtime/disabledeventpipeinternal.cpp index f2de93e..4f34808 100644 --- a/src/coreclr/nativeaot/Runtime/disabledeventpipeinternal.cpp +++ b/src/coreclr/nativeaot/Runtime/disabledeventpipeinternal.cpp @@ -1,23 +1,20 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -#include "common.h" -#include "eventpipeadapter.h" +#include "CommonTypes.h" +#include "CommonMacros.h" +#include "PalRedhawk.h" -#ifdef FEATURE_PERFTRACING +#include -#include "gcenv.h" -#include "regdisplay.h" -#include "StackFrameIterator.h" -#include "thread.h" -#include "SpinLock.h" +#ifdef FEATURE_PERFTRACING struct EventPipeEventInstanceData; struct EventPipeSessionInfo; EXTERN_C NATIVEAOT_API uint64_t __cdecl RhEventPipeInternal_Enable( - LPCWSTR outputFile, + const WCHAR* outputFile, EventPipeSerializationFormat format, uint32_t circularBufferSizeInMB, /* COR_PRF_EVENTPIPE_PROVIDER_CONFIG */ const void * pProviders, @@ -31,7 +28,7 @@ EXTERN_C NATIVEAOT_API void __cdecl RhEventPipeInternal_Disable(uint64_t session } EXTERN_C NATIVEAOT_API intptr_t __cdecl RhEventPipeInternal_CreateProvider( - LPCWSTR providerName, + const WCHAR* providerName, EventPipeCallback pCallbackFunc, void* pCallbackContext) { @@ -50,7 +47,7 @@ EXTERN_C NATIVEAOT_API intptr_t __cdecl RhEventPipeInternal_DefineEvent( return 0; } -EXTERN_C NATIVEAOT_API intptr_t __cdecl RhEventPipeInternal_GetProvider(LPCWSTR providerName) +EXTERN_C NATIVEAOT_API intptr_t __cdecl RhEventPipeInternal_GetProvider(const WCHAR* providerName) { return 0; } diff --git a/src/coreclr/nativeaot/Runtime/disabledruntimeeventinternal.cpp b/src/coreclr/nativeaot/Runtime/disabledruntimeeventinternal.cpp index 57ef8d3..6b3e76f 100644 --- a/src/coreclr/nativeaot/Runtime/disabledruntimeeventinternal.cpp +++ b/src/coreclr/nativeaot/Runtime/disabledruntimeeventinternal.cpp @@ -1,7 +1,9 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -#include "eventpipeadapter.h" +#include "CommonTypes.h" +#include "CommonMacros.h" +#include "PalRedhawk.h" #ifdef FEATURE_PERFTRACING @@ -78,7 +80,7 @@ EXTERN_C NATIVEAOT_API void __cdecl NativeRuntimeEventSource_LogThreadPoolIOPack { } -EXTERN_C NATIVEAOT_API void __cdecl NativeRuntimeEventSource_LogExceptionThrown(LPCWSTR exceptionTypeName, LPCWSTR exceptionMessage, void* faultingIP, HRESULT hresult) +EXTERN_C NATIVEAOT_API void __cdecl NativeRuntimeEventSource_LogExceptionThrown(const WCHAR* exceptionTypeName, const WCHAR* exceptionMessage, void* faultingIP, HRESULT hresult) { } diff --git a/src/coreclr/nativeaot/Runtime/eventpipe/CMakeLists.txt b/src/coreclr/nativeaot/Runtime/eventpipe/CMakeLists.txt index f911ede..ab6f781 100644 --- a/src/coreclr/nativeaot/Runtime/eventpipe/CMakeLists.txt +++ b/src/coreclr/nativeaot/Runtime/eventpipe/CMakeLists.txt @@ -107,7 +107,6 @@ list(APPEND GEN_EVENTPIPE_SOURCES list(APPEND AOT_EVENTPIPE_MANAGED_TO_NATIVE_SOURCES ${RUNTIME_DIR}/eventpipeinternal.cpp ${RUNTIME_DIR}/eventpipeadapter.h - ${RUNTIME_DIR}/diagnosticserveradapter.h ${RUNTIME_DIR}/EnabledEventPipeInterface.cpp ${RUNTIME_DIR}/runtimeeventinternal.cpp ) diff --git a/src/coreclr/nativeaot/Runtime/eventpipe/dotnetruntime.cpp b/src/coreclr/nativeaot/Runtime/eventpipe/dotnetruntime.cpp index 0bf1eee..95560af 100644 --- a/src/coreclr/nativeaot/Runtime/eventpipe/dotnetruntime.cpp +++ b/src/coreclr/nativeaot/Runtime/eventpipe/dotnetruntime.cpp @@ -6,9 +6,11 @@ // @TODO: Audit native events in NativeAOT Runtime #include -#include "eventpipeadapter.h" -#include "eventtrace_context.h" -#include "gcheaputilities.h" +#include + +#include +#include +#include #ifndef ERROR_WRITE_FAULT #define ERROR_WRITE_FAULT 29L @@ -3011,7 +3013,7 @@ void InitDotNETRuntime(void) bool DotNETRuntimeProvider_IsEnabled(unsigned char level, unsigned long long keyword) { - if (!EventPipeAdapter::Enabled()) + if (!ep_enabled()) return false; EVENTPIPE_TRACE_CONTEXT& context = MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context.EventPipeProvider; diff --git a/src/coreclr/nativeaot/Runtime/eventpipeadapter.h b/src/coreclr/nativeaot/Runtime/eventpipeadapter.h index 9f1b67d..b43c4be 100644 --- a/src/coreclr/nativeaot/Runtime/eventpipeadapter.h +++ b/src/coreclr/nativeaot/Runtime/eventpipeadapter.h @@ -17,28 +17,12 @@ #include #include -#include "gcenv.h" -#include "regdisplay.h" -#include "StackFrameIterator.h" -#include "thread.h" -#include "holder.h" -#include "SpinLock.h" +#include "CommonTypes.h" class EventPipeAdapter final { public: - static inline void Initialize() - { - CONTRACTL - { - NOTHROW; - } - CONTRACTL_END; - - ep_init(); - } - - static inline EventPipeProvider * CreateProvider(LPCWSTR providerName, EventPipeCallback callback, void* pCallbackContext = nullptr) + static inline EventPipeProvider * CreateProvider(const WCHAR* providerName, EventPipeCallback callback, void* pCallbackContext = nullptr) { ep_char8_t *providerNameUTF8 = ep_rt_utf16_to_utf8_string(reinterpret_cast(providerName), -1); EventPipeProvider * provider = ep_create_provider (providerNameUTF8, callback, pCallbackContext); @@ -46,66 +30,6 @@ public: return provider; } - static inline void DeleteProvider (EventPipeProvider * provider) - { - ep_delete_provider (provider); - } - - - static inline void FinishInitialize() - { - CONTRACTL - { - NOTHROW; - } - CONTRACTL_END; - - ep_finish_init(); - } - - static inline void Shutdown() - { - ep_shutdown(); - } - - static inline bool Enabled() - { - STATIC_CONTRACT_NOTHROW; - return ep_enabled(); - } - - static inline void Disable(EventPipeSessionID id) - { - CONTRACTL - { - NOTHROW; - GC_TRIGGERS; - MODE_ANY; - } - CONTRACTL_END; - - ep_disable(id); - } - - static inline EventPipeProvider * GetProvider (LPCWSTR providerName) - { - CONTRACTL - { - NOTHROW; - GC_NOTRIGGER; - MODE_ANY; - } - CONTRACTL_END; - - if (!providerName) - return NULL; - - ep_char8_t *providerNameUTF8 = ep_rt_utf16_to_utf8_string(reinterpret_cast(providerName), -1); - EventPipeProvider * provider = ep_get_provider (providerNameUTF8); - ep_rt_utf8_string_free(providerNameUTF8); - return provider; - } - static inline EventPipeEvent * AddEvent( EventPipeProvider *provider, uint32_t eventID, diff --git a/src/coreclr/nativeaot/Runtime/eventpipeinternal.cpp b/src/coreclr/nativeaot/Runtime/eventpipeinternal.cpp index 7cf502d..ca66bca 100644 --- a/src/coreclr/nativeaot/Runtime/eventpipeinternal.cpp +++ b/src/coreclr/nativeaot/Runtime/eventpipeinternal.cpp @@ -3,12 +3,7 @@ #include "common.h" #include "eventpipeadapter.h" - -#include "gcenv.h" -#include "regdisplay.h" -#include "StackFrameIterator.h" -#include "thread.h" -#include "SpinLock.h" +#include "PalRedhawk.h" #ifdef FEATURE_PERFTRACING @@ -17,7 +12,7 @@ struct EventPipeEventInstanceData void *ProviderID; unsigned int EventID; unsigned int ThreadID; - LARGE_INTEGER TimeStamp; + int64_t TimeStamp; GUID ActivityId; GUID RelatedActivityId; const uint8_t *Payload; @@ -40,7 +35,7 @@ struct EventPipeProviderConfigurationNative }; EXTERN_C NATIVEAOT_API uint64_t __cdecl RhEventPipeInternal_Enable( - LPCWSTR outputFile, + const WCHAR* outputFile, EventPipeSerializationFormat format, uint32_t circularBufferSizeInMB, /* COR_PRF_EVENTPIPE_PROVIDER_CONFIG */ const void * pProviders, @@ -102,11 +97,11 @@ EXTERN_C NATIVEAOT_API uint64_t __cdecl RhEventPipeInternal_Enable( EXTERN_C NATIVEAOT_API void __cdecl RhEventPipeInternal_Disable(uint64_t sessionID) { - EventPipeAdapter::Disable(sessionID); + ep_disable(sessionID); } EXTERN_C NATIVEAOT_API intptr_t __cdecl RhEventPipeInternal_CreateProvider( - LPCWSTR providerName, + const WCHAR* providerName, EventPipeCallback pCallbackFunc, void* pCallbackContext) { @@ -133,10 +128,17 @@ EXTERN_C NATIVEAOT_API intptr_t __cdecl RhEventPipeInternal_DefineEvent( return reinterpret_cast(pEvent); } -EXTERN_C NATIVEAOT_API intptr_t __cdecl RhEventPipeInternal_GetProvider(LPCWSTR providerName) +EXTERN_C NATIVEAOT_API intptr_t __cdecl RhEventPipeInternal_GetProvider(const WCHAR* providerName) { - EventPipeProvider* pProvider = EventPipeAdapter::GetProvider(providerName); - return reinterpret_cast(pProvider); + EventPipeProvider * provider = NULL; + if (providerName) + { + ep_char8_t *providerNameUTF8 = ep_rt_utf16_to_utf8_string(reinterpret_cast(providerName), -1); + provider = ep_get_provider (providerNameUTF8); + ep_rt_utf8_string_free(providerNameUTF8); + } + + return reinterpret_cast(provider); } EXTERN_C NATIVEAOT_API void __cdecl RhEventPipeInternal_DeleteProvider(intptr_t provHandle) @@ -144,7 +146,7 @@ EXTERN_C NATIVEAOT_API void __cdecl RhEventPipeInternal_DeleteProvider(intptr_t if (provHandle != 0) { EventPipeProvider *pProvider = reinterpret_cast(provHandle); - EventPipeAdapter::DeleteProvider(pProvider); + ep_delete_provider(pProvider); } } @@ -251,7 +253,7 @@ EXTERN_C NATIVEAOT_API UInt32_BOOL __cdecl RhEventPipeInternal_GetNextEvent(uint pInstance->ProviderID = ep_event_get_provider(ep_event_instance_get_ep_event(pNextInstance)); pInstance->EventID = ep_event_get_event_id(ep_event_instance_get_ep_event(pNextInstance)); pInstance->ThreadID = static_cast(ep_event_get_event_id(ep_event_instance_get_ep_event(pNextInstance))); - pInstance->TimeStamp.QuadPart = ep_event_instance_get_timestamp(pNextInstance); + pInstance->TimeStamp = ep_event_instance_get_timestamp(pNextInstance); pInstance->ActivityId = *reinterpret_cast(ep_event_instance_get_activity_id_cref(pNextInstance)); pInstance->RelatedActivityId = *reinterpret_cast(ep_event_instance_get_related_activity_id_cref(pNextInstance)); pInstance->Payload = ep_event_instance_get_data(pNextInstance); @@ -267,7 +269,7 @@ EXTERN_C NATIVEAOT_API UInt32_BOOL __cdecl RhEventPipeInternal_SignalSession(uin if (!session) return false; - return ep_rt_wait_event_set (ep_session_get_wait_event (session)); + return ep_rt_wait_event_set (ep_session_get_wait_event (session)); } EXTERN_C NATIVEAOT_API UInt32_BOOL __cdecl RhEventPipeInternal_WaitForSessionSignal(uint64_t sessionID, int32_t timeoutMs) diff --git a/src/coreclr/nativeaot/Runtime/gcenv.h b/src/coreclr/nativeaot/Runtime/gcenv.h index ad01f7f..cf9e5ad 100644 --- a/src/coreclr/nativeaot/Runtime/gcenv.h +++ b/src/coreclr/nativeaot/Runtime/gcenv.h @@ -14,6 +14,11 @@ #include #include +#ifdef TARGET_UNIX +#include +#endif + +#include "rhassert.h" #include "sal.h" #include "gcenv.structs.h" #include "gcenv.interlocked.h" diff --git a/src/coreclr/nativeaot/Runtime/inc/TargetPtrs.h b/src/coreclr/nativeaot/Runtime/inc/TargetPtrs.h index e4778f9..0ef7f5e 100644 --- a/src/coreclr/nativeaot/Runtime/inc/TargetPtrs.h +++ b/src/coreclr/nativeaot/Runtime/inc/TargetPtrs.h @@ -3,8 +3,6 @@ #ifndef _TARGETPTRS_H_ #define _TARGETPTRS_H_ -typedef DPTR(class MethodTable) PTR_EEType; - #ifdef TARGET_AMD64 typedef uint64_t UIntTarget; #elif defined(TARGET_X86) @@ -19,11 +17,7 @@ typedef uint32_t UIntTarget; #error unexpected target architecture #endif -typedef PTR_UInt8 TgtPTR_UInt8; -typedef PTR_UInt32 TgtPTR_UInt32; typedef void * TgtPTR_Void; -typedef PTR_EEType TgtPTR_EEType; typedef class Thread * TgtPTR_Thread; -typedef struct CORINFO_Object * TgtPTR_CORINFO_Object; #endif // !_TARGETPTRS_H_ diff --git a/src/coreclr/nativeaot/Runtime/inc/rhbinder.h b/src/coreclr/nativeaot/Runtime/inc/rhbinder.h index 4372c5c..5d7040d 100644 --- a/src/coreclr/nativeaot/Runtime/inc/rhbinder.h +++ b/src/coreclr/nativeaot/Runtime/inc/rhbinder.h @@ -6,6 +6,7 @@ // // This header contains binder-generated data structures that the runtime consumes. // +#include "daccess.h" // DPTR #include "TargetPtrs.h" class MethodTable; diff --git a/src/coreclr/nativeaot/Runtime/regdisplay.h b/src/coreclr/nativeaot/Runtime/regdisplay.h index 90a0250..eae75ea 100644 --- a/src/coreclr/nativeaot/Runtime/regdisplay.h +++ b/src/coreclr/nativeaot/Runtime/regdisplay.h @@ -6,6 +6,8 @@ #if defined(TARGET_X86) || defined(TARGET_AMD64) +#include "PalRedhawkCommon.h" // Fp128 + struct REGDISPLAY { PTR_UIntNative pRax; diff --git a/src/coreclr/nativeaot/Runtime/runtimeeventinternal.cpp b/src/coreclr/nativeaot/Runtime/runtimeeventinternal.cpp index eebe490..b346ef5 100644 --- a/src/coreclr/nativeaot/Runtime/runtimeeventinternal.cpp +++ b/src/coreclr/nativeaot/Runtime/runtimeeventinternal.cpp @@ -1,7 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -#include "eventpipeadapter.h" +#include "gcenv.h" #ifdef FEATURE_PERFTRACING @@ -90,7 +90,7 @@ EXTERN_C NATIVEAOT_API void __cdecl NativeRuntimeEventSource_LogThreadPoolIOPack FireEtwThreadPoolIOPack(NativeOverlapped, Overlapped, ClrInstanceID); } -EXTERN_C NATIVEAOT_API void __cdecl NativeRuntimeEventSource_LogExceptionThrown(LPCWSTR exceptionTypeName, LPCWSTR exceptionMessage, void* faultingIP, HRESULT hresult) +EXTERN_C NATIVEAOT_API void __cdecl NativeRuntimeEventSource_LogExceptionThrown(const WCHAR* exceptionTypeName, const WCHAR* exceptionMessage, void* faultingIP, HRESULT hresult) { FireEtwExceptionThrown_V1(exceptionTypeName, exceptionMessage, diff --git a/src/coreclr/nativeaot/Runtime/startup.cpp b/src/coreclr/nativeaot/Runtime/startup.cpp index 272dd8e..32cbab5 100644 --- a/src/coreclr/nativeaot/Runtime/startup.cpp +++ b/src/coreclr/nativeaot/Runtime/startup.cpp @@ -100,10 +100,10 @@ static bool InitDLL(HANDLE hPalInstance) #ifdef FEATURE_PERFTRACING // Initialize EventPipe - EventPipeAdapter_Initialize(); + EventPipe_Initialize(); // Initialize DS - DiagnosticServerAdapter_Initialize(); - DiagnosticServerAdapter_PauseForDiagnosticsMonitor(); + DiagnosticServer_Initialize(); + DiagnosticServer_PauseForDiagnosticsMonitor(); #endif #ifdef FEATURE_EVENT_TRACE EventTracing_Initialize(); @@ -157,7 +157,7 @@ static bool InitDLL(HANDLE hPalInstance) // Finish setting up rest of EventPipe - specifically enable SampleProfiler if it was requested at startup. // SampleProfiler needs to cooperate with the GC which hasn't fully finished setting up in the first part of the // EventPipe initialization, so this is done after the GC has been fully initialized. - EventPipeAdapter_FinishInitialize(); + EventPipe_FinishInitialize(); #endif #ifndef USE_PORTABLE_HELPERS @@ -309,8 +309,8 @@ static void __cdecl OnProcessExit() #endif #ifdef FEATURE_PERFTRACING - EventPipeAdapter_Shutdown(); - DiagnosticServerAdapter_Shutdown(); + EventPipe_Shutdown(); + DiagnosticServer_Shutdown(); #endif } @@ -342,7 +342,7 @@ void RuntimeThreadShutdown(void* thread) #endif ThreadStore::DetachCurrentThread(); - + #ifdef FEATURE_PERFTRACING EventPipe_ThreadShutdown(); #endif diff --git a/src/coreclr/nativeaot/Runtime/thread.h b/src/coreclr/nativeaot/Runtime/thread.h index 3931095..1213c3e 100644 --- a/src/coreclr/nativeaot/Runtime/thread.h +++ b/src/coreclr/nativeaot/Runtime/thread.h @@ -4,10 +4,8 @@ #ifndef __thread_h__ #define __thread_h__ -#include "regdisplay.h" #include "StackFrameIterator.h" - -#include "forward_declarations.h" +#include "slist.h" // DefaultSListTraits struct gc_alloc_context; class RuntimeInstance; -- 2.7.4