Skip to content

Commit

Permalink
Share EventSource QCall definitions between NAOT and CoreCLR (#99441)
Browse files Browse the repository at this point in the history
  • Loading branch information
jkotas authored Mar 10, 2024
1 parent 03b5de7 commit 82dac28
Show file tree
Hide file tree
Showing 18 changed files with 106 additions and 557 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,6 @@
<Compile Include="$(BclSourcesRoot)\System\Delegate.CoreCLR.cs" />
<Compile Include="$(BclSourcesRoot)\System\Diagnostics\Debugger.cs" />
<Compile Include="$(BclSourcesRoot)\System\Diagnostics\EditAndContinueHelper.cs" />
<Compile Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\EventPipe.CoreCLR.cs" />
<Compile Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\NativeRuntimeEventSource.Threading.NativeSinks.CoreCLR.cs" />
<Compile Include="$(BclSourcesRoot)\System\Diagnostics\ICustomDebuggerNotification.cs" />
<Compile Include="$(BclSourcesRoot)\System\Diagnostics\StackFrame.CoreCLR.cs" />
<Compile Include="$(BclSourcesRoot)\System\Diagnostics\StackFrameHelper.cs" />
Expand Down
24 changes: 12 additions & 12 deletions src/coreclr/nativeaot/Runtime/disabledeventpipeinternal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ struct EventPipeEventInstanceData;

struct EventPipeSessionInfo;

EXTERN_C uint64_t QCALLTYPE RhEventPipeInternal_Enable(
EXTERN_C uint64_t QCALLTYPE EventPipeInternal_Enable(
const WCHAR* outputFile,
EventPipeSerializationFormat format,
uint32_t circularBufferSizeInMB,
Expand All @@ -23,19 +23,19 @@ EXTERN_C uint64_t QCALLTYPE RhEventPipeInternal_Enable(
return 0;
}

EXTERN_C void QCALLTYPE RhEventPipeInternal_Disable(uint64_t sessionID)
EXTERN_C void QCALLTYPE EventPipeInternal_Disable(uint64_t sessionID)
{
}

EXTERN_C intptr_t QCALLTYPE RhEventPipeInternal_CreateProvider(
EXTERN_C intptr_t QCALLTYPE EventPipeInternal_CreateProvider(
const WCHAR* providerName,
EventPipeCallback pCallbackFunc,
void* pCallbackContext)
{
return 0;
}

EXTERN_C intptr_t QCALLTYPE RhEventPipeInternal_DefineEvent(
EXTERN_C intptr_t QCALLTYPE EventPipeInternal_DefineEvent(
intptr_t provHandle,
uint32_t eventID,
int64_t keywords,
Expand All @@ -47,21 +47,21 @@ EXTERN_C intptr_t QCALLTYPE RhEventPipeInternal_DefineEvent(
return 0;
}

EXTERN_C intptr_t QCALLTYPE RhEventPipeInternal_GetProvider(const WCHAR* providerName)
EXTERN_C intptr_t QCALLTYPE EventPipeInternal_GetProvider(const WCHAR* providerName)
{
return 0;
}

EXTERN_C void QCALLTYPE RhEventPipeInternal_DeleteProvider(intptr_t provHandle)
EXTERN_C void QCALLTYPE EventPipeInternal_DeleteProvider(intptr_t provHandle)
{
}

EXTERN_C int QCALLTYPE RhEventPipeInternal_EventActivityIdControl(uint32_t controlCode, GUID *pActivityId)
EXTERN_C int QCALLTYPE EventPipeInternal_EventActivityIdControl(uint32_t controlCode, GUID *pActivityId)
{
return 0;
}

EXTERN_C void QCALLTYPE RhEventPipeInternal_WriteEventData(
EXTERN_C void QCALLTYPE EventPipeInternal_WriteEventData(
intptr_t eventHandle,
EventData *pEventData,
uint32_t eventDataCount,
Expand All @@ -70,22 +70,22 @@ EXTERN_C void QCALLTYPE RhEventPipeInternal_WriteEventData(
{
}

EXTERN_C UInt32_BOOL QCALLTYPE RhEventPipeInternal_GetSessionInfo(uint64_t sessionID, EventPipeSessionInfo *pSessionInfo)
EXTERN_C UInt32_BOOL QCALLTYPE EventPipeInternal_GetSessionInfo(uint64_t sessionID, EventPipeSessionInfo *pSessionInfo)
{
return FALSE;
}

EXTERN_C UInt32_BOOL QCALLTYPE RhEventPipeInternal_GetNextEvent(uint64_t sessionID, EventPipeEventInstanceData *pInstance)
EXTERN_C UInt32_BOOL QCALLTYPE EventPipeInternal_GetNextEvent(uint64_t sessionID, EventPipeEventInstanceData *pInstance)
{
return FALSE;
}

EXTERN_C UInt32_BOOL QCALLTYPE RhEventPipeInternal_SignalSession(uint64_t sessionID)
EXTERN_C UInt32_BOOL QCALLTYPE EventPipeInternal_SignalSession(uint64_t sessionID)
{
return FALSE;
}

EXTERN_C UInt32_BOOL QCALLTYPE RhEventPipeInternal_WaitForSessionSignal(uint64_t sessionID, int32_t timeoutMs)
EXTERN_C UInt32_BOOL QCALLTYPE EventPipeInternal_WaitForSessionSignal(uint64_t sessionID, int32_t timeoutMs)
{
return FALSE;
}
Expand Down
24 changes: 12 additions & 12 deletions src/coreclr/nativeaot/Runtime/eventpipeinternal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ struct EventPipeProviderConfigurationNative
WCHAR *pFilterData;
};

EXTERN_C uint64_t QCALLTYPE RhEventPipeInternal_Enable(
EXTERN_C uint64_t QCALLTYPE EventPipeInternal_Enable(
const WCHAR* outputFile,
EventPipeSerializationFormat format,
uint32_t circularBufferSizeInMB,
Expand Down Expand Up @@ -104,12 +104,12 @@ EXTERN_C uint64_t QCALLTYPE RhEventPipeInternal_Enable(
return result;
}

EXTERN_C void QCALLTYPE RhEventPipeInternal_Disable(uint64_t sessionID)
EXTERN_C void QCALLTYPE EventPipeInternal_Disable(uint64_t sessionID)
{
ep_disable(sessionID);
}

EXTERN_C intptr_t QCALLTYPE RhEventPipeInternal_CreateProvider(
EXTERN_C intptr_t QCALLTYPE EventPipeInternal_CreateProvider(
const WCHAR* providerName,
EventPipeCallback pCallbackFunc,
void* pCallbackContext)
Expand All @@ -120,7 +120,7 @@ EXTERN_C intptr_t QCALLTYPE RhEventPipeInternal_CreateProvider(
return reinterpret_cast<intptr_t>(pProvider);
}

EXTERN_C intptr_t QCALLTYPE RhEventPipeInternal_DefineEvent(
EXTERN_C intptr_t QCALLTYPE EventPipeInternal_DefineEvent(
intptr_t provHandle,
uint32_t eventID,
int64_t keywords,
Expand All @@ -139,7 +139,7 @@ EXTERN_C intptr_t QCALLTYPE RhEventPipeInternal_DefineEvent(
return reinterpret_cast<intptr_t>(pEvent);
}

EXTERN_C intptr_t QCALLTYPE RhEventPipeInternal_GetProvider(const WCHAR* providerName)
EXTERN_C intptr_t QCALLTYPE EventPipeInternal_GetProvider(const WCHAR* providerName)
{
EventPipeProvider * provider = NULL;
if (providerName)
Expand All @@ -152,7 +152,7 @@ EXTERN_C intptr_t QCALLTYPE RhEventPipeInternal_GetProvider(const WCHAR* provide
return reinterpret_cast<intptr_t>(provider);
}

EXTERN_C void QCALLTYPE RhEventPipeInternal_DeleteProvider(intptr_t provHandle)
EXTERN_C void QCALLTYPE EventPipeInternal_DeleteProvider(intptr_t provHandle)
{
if (provHandle != 0)
{
Expand All @@ -172,7 +172,7 @@ enum class ActivityControlCode
EVENT_ACTIVITY_CONTROL_CREATE_SET_ID = 5
};

EXTERN_C int QCALLTYPE RhEventPipeInternal_EventActivityIdControl(uint32_t controlCode, GUID *pActivityId)
EXTERN_C int QCALLTYPE EventPipeInternal_EventActivityIdControl(uint32_t controlCode, GUID *pActivityId)
{
int retVal = 0;
ep_rt_thread_activity_id_handle_t activityIdHandle = ep_thread_get_activity_id_handle ();
Expand Down Expand Up @@ -224,7 +224,7 @@ EXTERN_C int QCALLTYPE RhEventPipeInternal_EventActivityIdControl(uint32_t contr
return retVal;
}

EXTERN_C void QCALLTYPE RhEventPipeInternal_WriteEventData(
EXTERN_C void QCALLTYPE EventPipeInternal_WriteEventData(
intptr_t eventHandle,
EventData *pEventData,
uint32_t eventDataCount,
Expand All @@ -236,7 +236,7 @@ EXTERN_C void QCALLTYPE RhEventPipeInternal_WriteEventData(
ep_write_event_2(pEvent, pEventData, eventDataCount, reinterpret_cast<const uint8_t*>(pActivityId), reinterpret_cast<const uint8_t*>(pRelatedActivityId));
}

EXTERN_C UInt32_BOOL QCALLTYPE RhEventPipeInternal_GetSessionInfo(uint64_t sessionID, EventPipeSessionInfo *pSessionInfo)
EXTERN_C UInt32_BOOL QCALLTYPE EventPipeInternal_GetSessionInfo(uint64_t sessionID, EventPipeSessionInfo *pSessionInfo)
{
bool retVal = false;
if (pSessionInfo != NULL)
Expand All @@ -253,7 +253,7 @@ EXTERN_C UInt32_BOOL QCALLTYPE RhEventPipeInternal_GetSessionInfo(uint64_t sessi
return retVal;
}

EXTERN_C UInt32_BOOL QCALLTYPE RhEventPipeInternal_GetNextEvent(uint64_t sessionID, EventPipeEventInstanceData *pInstance)
EXTERN_C UInt32_BOOL QCALLTYPE EventPipeInternal_GetNextEvent(uint64_t sessionID, EventPipeEventInstanceData *pInstance)
{
EventPipeEventInstance *pNextInstance = NULL;
_ASSERTE(pInstance != NULL);
Expand All @@ -274,7 +274,7 @@ EXTERN_C UInt32_BOOL QCALLTYPE RhEventPipeInternal_GetNextEvent(uint64_t session
return pNextInstance != NULL;
}

EXTERN_C UInt32_BOOL QCALLTYPE RhEventPipeInternal_SignalSession(uint64_t sessionID)
EXTERN_C UInt32_BOOL QCALLTYPE EventPipeInternal_SignalSession(uint64_t sessionID)
{
EventPipeSession *const session = ep_get_session (sessionID);
if (!session)
Expand All @@ -283,7 +283,7 @@ EXTERN_C UInt32_BOOL QCALLTYPE RhEventPipeInternal_SignalSession(uint64_t sessio
return ep_rt_wait_event_set (ep_session_get_wait_event (session));
}

EXTERN_C UInt32_BOOL QCALLTYPE RhEventPipeInternal_WaitForSessionSignal(uint64_t sessionID, int32_t timeoutMs)
EXTERN_C UInt32_BOOL QCALLTYPE EventPipeInternal_WaitForSessionSignal(uint64_t sessionID, int32_t timeoutMs)
{
EventPipeSession *const session = ep_get_session (sessionID);
if (!session)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,6 @@
<Compile Include="System\Diagnostics\StackFrame.NativeAot.cs" />
<Compile Include="System\Diagnostics\StackFrameExtensions.cs" />
<Compile Include="System\Diagnostics\StackTrace.NativeAot.cs" />
<Compile Include="System\Diagnostics\Eventing\EventPipe.NativeAot.cs" />
<Compile Include="System\Diagnostics\Eventing\NativeRuntimeEventSource.Threading.NativeSinks.NativeAot.cs" Condition="'$(FeaturePerfTracing)' == 'true'" />
<Compile Include="System\Enum.NativeAot.cs" />
<Compile Include="System\Environment.NativeAot.cs" />
<Compile Include="System\GC.NativeAot.cs" />
Expand Down

This file was deleted.

Loading

0 comments on commit 82dac28

Please sign in to comment.