From: Brian Robbins Date: Wed, 10 May 2017 22:11:28 +0000 (-0700) Subject: Re-Factor EventSource to Support Writing to EventPipe (#11435) X-Git-Tag: accepted/tizen/base/20180629.140029~1109^2~66 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=377073385e4545d36e1a96429dd78548f87c597c;p=platform%2Fupstream%2Fcoreclr.git Re-Factor EventSource to Support Writing to EventPipe (#11435) Re-Factor EventSource to Support Writing to EventPipe. --- diff --git a/clr.coreclr.props b/clr.coreclr.props index 5251eab..059fb3a 100644 --- a/clr.coreclr.props +++ b/clr.coreclr.props @@ -47,7 +47,7 @@ true true - true + false true true true @@ -76,15 +76,20 @@ false false false - false true true + true true true true + + + true + true + diff --git a/clr.defines.targets b/clr.defines.targets index 1dd41f1..df6a409 100644 --- a/clr.defines.targets +++ b/clr.defines.targets @@ -20,6 +20,7 @@ $(DefineConstants);FEATURE_MANAGED_ETW_CHANNELS $(DefineConstants);FEATURE_PAL $(DefineConstants);FEATURE_PATHCOMPAT + $(DefineConstants);FEATURE_PERFTRACING $(DefineConstants);FEATURE_EVENTSOURCE_XPLAT $(DefineConstants);FEATURE_RANDOMIZED_STRING_HASHING $(DefineConstants);FEATURE_SORT_TABLES diff --git a/clrdefinitions.cmake b/clrdefinitions.cmake index 92b63a3..6db2b24 100644 --- a/clrdefinitions.cmake +++ b/clrdefinitions.cmake @@ -135,9 +135,9 @@ if(FEATURE_INTERPRETER) endif(FEATURE_INTERPRETER) add_definitions(-DFEATURE_ISYM_READER) add_definitions(-DFEATURE_LOADER_OPTIMIZATION) -if (NOT CLR_CMAKE_PLATFORM_UNIX) +if (CLR_CMAKE_PLATFORM_LINUX OR WIN32) add_definitions(-DFEATURE_MANAGED_ETW) -endif(NOT CLR_CMAKE_PLATFORM_UNIX) +endif(CLR_CMAKE_PLATFORM_LINUX OR WIN32) add_definitions(-DFEATURE_MANAGED_ETW_CHANNELS) if(FEATURE_MERGE_JIT_AND_ENGINE) diff --git a/src/inc/CrstTypes.def b/src/inc/CrstTypes.def index 227f986..5bf4ec6 100644 --- a/src/inc/CrstTypes.def +++ b/src/inc/CrstTypes.def @@ -781,5 +781,5 @@ Crst InlineTrackingMap End Crst EventPipe - AcquiredBefore ThreadIdDispenser ThreadStore + AcquiredBefore ThreadIdDispenser ThreadStore DomainLocalBlock InstMethodHashTable End diff --git a/src/inc/crsttypes.h b/src/inc/crsttypes.h index b4f6f49..55dc5bd 100644 --- a/src/inc/crsttypes.h +++ b/src/inc/crsttypes.h @@ -237,7 +237,7 @@ int g_rgCrstLevelMap[] = 3, // CrstDynamicMT 3, // CrstDynLinkZapItems 7, // CrstEtwTypeLogHash - 11, // CrstEventPipe + 17, // CrstEventPipe 0, // CrstEventStore 0, // CrstException 7, // CrstExecuteManLock @@ -560,4 +560,3 @@ inline static LPCSTR GetCrstName(CrstType crstType) } #endif // defined(__IN_CRST_CPP) && defined(_DEBUG) - diff --git a/src/mscorlib/System.Private.CoreLib.csproj b/src/mscorlib/System.Private.CoreLib.csproj index e519199..ff4aa31 100644 --- a/src/mscorlib/System.Private.CoreLib.csproj +++ b/src/mscorlib/System.Private.CoreLib.csproj @@ -566,6 +566,7 @@ + diff --git a/src/mscorlib/shared/System.Private.CoreLib.Shared.projitems b/src/mscorlib/shared/System.Private.CoreLib.Shared.projitems index 3e00140..921354b 100644 --- a/src/mscorlib/shared/System.Private.CoreLib.Shared.projitems +++ b/src/mscorlib/shared/System.Private.CoreLib.Shared.projitems @@ -427,6 +427,7 @@ + diff --git a/src/mscorlib/shared/System/Diagnostics/Tracing/EventProvider.cs b/src/mscorlib/shared/System/Diagnostics/Tracing/EventProvider.cs index e18574c..e5316bc 100644 --- a/src/mscorlib/shared/System/Diagnostics/Tracing/EventProvider.cs +++ b/src/mscorlib/shared/System/Diagnostics/Tracing/EventProvider.cs @@ -78,6 +78,7 @@ namespace System.Diagnostics.Tracing private static bool m_setInformationMissing; + private IEventProvider m_eventProvider; // The interface that implements the specific logging mechanism functions. UnsafeNativeMethods.ManifestEtw.EtwEnableCallback m_etwCallback; // Trace Callback function private long m_regHandle; // Trace Registration Handle private byte m_level; // Tracing Level @@ -119,6 +120,11 @@ namespace System.Diagnostics.Tracing // EventSource has special logic to do this, no one else should be calling EventProvider. internal EventProvider() { +#if PLATFORM_WINDOWS + m_eventProvider = new EtwEventProvider(); +#elif FEATURE_PERFTRACING + m_eventProvider = new EventPipeEventProvider(); +#endif } /// @@ -429,7 +435,7 @@ namespace System.Diagnostics.Tracing // However the framework version of EventSource DOES have ES_SESSION_INFO defined and thus // does not have this issue. -#if ES_SESSION_INFO || !ES_BUILD_STANDALONE +#if (PLATFORM_WINDOWS && (ES_SESSION_INFO || !ES_BUILD_STANDALONE)) int buffSize = 256; // An initial guess that probably works most of the time. byte* buffer; for (; ; ) @@ -1056,7 +1062,7 @@ namespace System.Diagnostics.Tracing userDataPtr[refObjPosition[7]].Ptr = (ulong)v7; } - status = UnsafeNativeMethods.ManifestEtw.EventWriteTransferWrapper(m_regHandle, ref eventDescriptor, activityID, childActivityID, argCount, userData); + status = m_eventProvider.EventWriteTransferWrapper(m_regHandle, ref eventDescriptor, activityID, childActivityID, argCount, userData); } } else @@ -1082,7 +1088,7 @@ namespace System.Diagnostics.Tracing } } - status = UnsafeNativeMethods.ManifestEtw.EventWriteTransferWrapper(m_regHandle, ref eventDescriptor, activityID, childActivityID, argCount, userData); + status = m_eventProvider.EventWriteTransferWrapper(m_regHandle, ref eventDescriptor, activityID, childActivityID, argCount, userData); for (int i = 0; i < refObjIndex; ++i) { @@ -1135,7 +1141,7 @@ namespace System.Diagnostics.Tracing (EventOpcode)eventDescriptor.Opcode == EventOpcode.Stop); } - int status = UnsafeNativeMethods.ManifestEtw.EventWriteTransferWrapper(m_regHandle, ref eventDescriptor, activityID, childActivityID, dataCount, (EventData*)data); + int status = m_eventProvider.EventWriteTransferWrapper(m_regHandle, ref eventDescriptor, activityID, childActivityID, dataCount, (EventData*)data); if (status != 0) { @@ -1155,7 +1161,7 @@ namespace System.Diagnostics.Tracing { int status; - status = UnsafeNativeMethods.ManifestEtw.EventWriteTransferWrapper( + status = m_eventProvider.EventWriteTransferWrapper( m_regHandle, ref eventDescriptor, activityID, @@ -1178,12 +1184,12 @@ namespace System.Diagnostics.Tracing { m_providerId = providerId; m_etwCallback = enableCallback; - return UnsafeNativeMethods.ManifestEtw.EventRegister(ref providerId, enableCallback, null, ref m_regHandle); + return m_eventProvider.EventRegister(ref providerId, enableCallback, null, ref m_regHandle); } private uint EventUnregister(long registrationHandle) { - return UnsafeNativeMethods.ManifestEtw.EventUnregister(registrationHandle); + return m_eventProvider.EventUnregister(registrationHandle); } static int[] nibblebits = { 0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4 }; @@ -1203,5 +1209,59 @@ namespace System.Diagnostics.Tracing return idx; } } + +#if PLATFORM_WINDOWS + + // A wrapper around the ETW-specific API calls. + internal sealed class EtwEventProvider : IEventProvider + { + // Register an event provider. + unsafe uint IEventProvider.EventRegister( + ref Guid providerId, + UnsafeNativeMethods.ManifestEtw.EtwEnableCallback enableCallback, + void* callbackContext, + ref long registrationHandle) + { + return UnsafeNativeMethods.ManifestEtw.EventRegister( + ref providerId, + enableCallback, + callbackContext, + ref registrationHandle); + } + + // Unregister an event provider. + uint IEventProvider.EventUnregister(long registrationHandle) + { + return UnsafeNativeMethods.ManifestEtw.EventUnregister(registrationHandle); + } + + // Write an event. + unsafe int IEventProvider.EventWriteTransferWrapper( + long registrationHandle, + ref EventDescriptor eventDescriptor, + Guid* activityId, + Guid* relatedActivityId, + int userDataCount, + EventProvider.EventData* userData) + { + return UnsafeNativeMethods.ManifestEtw.EventWriteTransferWrapper( + registrationHandle, + ref eventDescriptor, + activityId, + relatedActivityId, + userDataCount, + userData); + } + + // Get or set the per-thread activity ID. + int IEventProvider.EventActivityIdControl(UnsafeNativeMethods.ManifestEtw.ActivityControl ControlCode, ref Guid ActivityId) + { + return UnsafeNativeMethods.ManifestEtw.EventActivityIdControl( + ControlCode, + ref ActivityId); + } + } + +#endif } diff --git a/src/mscorlib/shared/System/Diagnostics/Tracing/EventSource.cs b/src/mscorlib/shared/System/Diagnostics/Tracing/EventSource.cs index cf4901d..483b1f8 100644 --- a/src/mscorlib/shared/System/Diagnostics/Tracing/EventSource.cs +++ b/src/mscorlib/shared/System/Diagnostics/Tracing/EventSource.cs @@ -4,16 +4,10 @@ // This program uses code hyperlinks available as part of the HyperAddin Visual Studio plug-in. // It is available from http://www.codeplex.com/hyperAddin -#if PLATFORM_WINDOWS - -#define FEATURE_MANAGED_ETW - #if !ES_BUILD_STANDALONE && !CORECLR && !ES_BUILD_PN #define FEATURE_ACTIVITYSAMPLING #endif // !ES_BUILD_STANDALONE -#endif // PLATFORM_WINDOWS - #if ES_BUILD_STANDALONE #define FEATURE_MANAGED_ETW_CHANNELS // #define FEATURE_ADVANCED_MANAGED_ETW_CHANNELS @@ -1474,7 +1468,7 @@ namespace System.Diagnostics.Tracing // Set m_provider, which allows this. m_provider = provider; -#if (!ES_BUILD_STANDALONE && !ES_BUILD_PN) +#if (!ES_BUILD_STANDALONE && !ES_BUILD_PN && !PLATFORM_UNIX) // API available on OS >= Win 8 and patched Win 7. // Disable only for FrameworkEventSource to avoid recursion inside exception handling. if (this.Name != "System.Diagnostics.Eventing.FrameworkEventSource" || Environment.IsWindows8OrAbove) diff --git a/src/mscorlib/shared/System/Diagnostics/Tracing/IEventProvider.cs b/src/mscorlib/shared/System/Diagnostics/Tracing/IEventProvider.cs new file mode 100644 index 0000000..0b51e52 --- /dev/null +++ b/src/mscorlib/shared/System/Diagnostics/Tracing/IEventProvider.cs @@ -0,0 +1,38 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using Microsoft.Win32; + +#if ES_BUILD_STANDALONE +namespace Microsoft.Diagnostics.Tracing +#else +namespace System.Diagnostics.Tracing +#endif +{ + // Represents the interface between EventProvider and an external logging mechanism. + internal interface IEventProvider + { + // Register an event provider. + unsafe uint EventRegister( + ref Guid providerId, + UnsafeNativeMethods.ManifestEtw.EtwEnableCallback enableCallback, + void* callbackContext, + ref long registrationHandle); + + // Unregister an event provider. + uint EventUnregister(long registrationHandle); + + // Write an event. + unsafe int EventWriteTransferWrapper( + long registrationHandle, + ref EventDescriptor eventDescriptor, + Guid* activityId, + Guid* relatedActivityId, + int userDataCount, + EventProvider.EventData* userData); + + // Get or set the per-thread activity ID. + int EventActivityIdControl(UnsafeNativeMethods.ManifestEtw.ActivityControl ControlCode, ref Guid ActivityId); + } +} diff --git a/src/mscorlib/src/System/Diagnostics/Eventing/EventPipeEventProvider.cs b/src/mscorlib/src/System/Diagnostics/Eventing/EventPipeEventProvider.cs new file mode 100644 index 0000000..5917ecc --- /dev/null +++ b/src/mscorlib/src/System/Diagnostics/Eventing/EventPipeEventProvider.cs @@ -0,0 +1,86 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. +using System.Collections.Concurrent; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Security; +using Microsoft.Win32; + +namespace System.Diagnostics.Tracing +{ + internal sealed class EventPipeEventProvider : IEventProvider + { + // The EventPipeProvider handle. + private IntPtr m_provHandle = IntPtr.Zero; + + // Register an event provider. + unsafe uint IEventProvider.EventRegister( + ref Guid providerId, + UnsafeNativeMethods.ManifestEtw.EtwEnableCallback enableCallback, + void* callbackContext, + ref long registrationHandle) + { + uint returnStatus = 0; + m_provHandle = EventPipeInternal.CreateProvider(providerId, enableCallback); + if(m_provHandle != IntPtr.Zero) + { + // Fixed registration handle because a new EventPipeEventProvider + // will be created for each new EventSource. + registrationHandle = 1; + } + else + { + // Unable to create the provider. + returnStatus = 1; + } + + return returnStatus; + } + + // Unregister an event provider. + uint IEventProvider.EventUnregister(long registrationHandle) + { + EventPipeInternal.DeleteProvider(m_provHandle); + return 0; + } + + // Write an event. + unsafe int IEventProvider.EventWriteTransferWrapper( + long registrationHandle, + ref EventDescriptor eventDescriptor, + Guid* activityId, + Guid* relatedActivityId, + int userDataCount, + EventProvider.EventData* userData) + { + return 0; + } + + // Get or set the per-thread activity ID. + int IEventProvider.EventActivityIdControl(UnsafeNativeMethods.ManifestEtw.ActivityControl ControlCode, ref Guid ActivityId) + { + return 0; + } + } + + // PInvokes into the runtime used to interact with the EventPipe. + internal static class EventPipeInternal + { + [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] + [SuppressUnmanagedCodeSecurity] + internal static extern IntPtr CreateProvider(Guid providerID, UnsafeNativeMethods.ManifestEtw.EtwEnableCallback callbackFunc); + + [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] + [SuppressUnmanagedCodeSecurity] + internal static extern IntPtr AddEvent(IntPtr provHandle, Int64 keywords, uint eventID, uint eventVersion, uint level, bool needStack); + + [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] + [SuppressUnmanagedCodeSecurity] + internal static extern void DeleteProvider(IntPtr provHandle); + + [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] + [SuppressUnmanagedCodeSecurity] + internal static extern unsafe void WriteEvent(IntPtr eventHandle, void* data, uint length); + } +} diff --git a/src/vm/ecalllist.h b/src/vm/ecalllist.h index cc6966e..ef82daa 100644 --- a/src/vm/ecalllist.h +++ b/src/vm/ecalllist.h @@ -1271,6 +1271,15 @@ FCFuncStart(gEventLogger) FCFuncEnd() #endif // defined(FEATURE_EVENTSOURCE_XPLAT) +#ifdef FEATURE_PERFTRACING +FCFuncStart(gEventPipeInternalFuncs) + QCFuncElement("CreateProvider", EventPipeInternal::CreateProvider) + QCFuncElement("AddEvent", EventPipeInternal::AddEvent) + QCFuncElement("DeleteProvider", EventPipeInternal::DeleteProvider) + QCFuncElement("WriteEvent", EventPipeInternal::WriteEvent) +FCFuncEnd() +#endif // FEATURE_PERFTRACING + #ifdef FEATURE_COMINTEROP FCFuncStart(gRuntimeClassFuncs) FCFuncElement("GetRedirectedGetHashCodeMD", ComObject::GetRedirectedGetHashCodeMD) @@ -1374,6 +1383,9 @@ FCClassElement("Environment", "System", gEnvironmentFuncs) #ifdef FEATURE_COMINTEROP FCClassElement("EventArgsMarshaler", "System.StubHelpers", gEventArgsMarshalerFuncs) #endif // FEATURE_COMINTEROP +#if defined(FEATURE_PERFTRACING) +FCClassElement("EventPipeInternal", "System.Diagnostics.Tracing", gEventPipeInternalFuncs) +#endif // FEATURE_PERFTRACING FCClassElement("Exception", "System", gExceptionFuncs) FCClassElement("FileLoadException", "System.IO", gFileLoadExceptionFuncs) FCClassElement("FormatterServices", "System.Runtime.Serialization", gSerializationFuncs) diff --git a/src/vm/eventpipe.cpp b/src/vm/eventpipe.cpp index 8ea3f08..bed4cfd 100644 --- a/src/vm/eventpipe.cpp +++ b/src/vm/eventpipe.cpp @@ -184,8 +184,10 @@ void EventPipe::WriteEvent(EventPipeEvent &event, BYTE *pData, unsigned int leng length); // Write to the EventPipeFile. - _ASSERTE(s_pFile != NULL); - s_pFile->WriteEvent(instance); + if(s_pFile != NULL) + { + s_pFile->WriteEvent(instance); + } // Write to the EventPipeJsonFile if it exists. if(s_pJsonFile != NULL) @@ -306,4 +308,67 @@ CrstStatic* EventPipe::GetLock() return &s_configCrst; } +INT_PTR QCALLTYPE EventPipeInternal::CreateProvider( + GUID providerID, + EventPipeCallback pCallbackFunc) +{ + QCALL_CONTRACT; + + EventPipeProvider *pProvider = NULL; + + BEGIN_QCALL; + + pProvider = new EventPipeProvider(providerID, pCallbackFunc, NULL); + + END_QCALL; + + return reinterpret_cast(pProvider); +} + +INT_PTR QCALLTYPE EventPipeInternal::AddEvent( + INT_PTR provHandle, + __int64 keywords, + unsigned int eventID, + unsigned int eventVersion, + unsigned int level, + bool needStack) +{ + QCALL_CONTRACT; + BEGIN_QCALL; + + // TODO + + END_QCALL; + + return 0; +} + +void QCALLTYPE EventPipeInternal::DeleteProvider( + INT_PTR provHandle) +{ + QCALL_CONTRACT; + BEGIN_QCALL; + + if(provHandle != NULL) + { + EventPipeProvider *pProvider = reinterpret_cast(provHandle); + delete pProvider; + } + + END_QCALL; +} + +void QCALLTYPE EventPipeInternal::WriteEvent( + INT_PTR eventHandle, + void *pData, + unsigned int length) +{ + QCALL_CONTRACT; + BEGIN_QCALL; + + // TODO + + END_QCALL; +} + #endif // FEATURE_PERFTRACING diff --git a/src/vm/eventpipe.h b/src/vm/eventpipe.h index c6d7f61..d5b85f7 100644 --- a/src/vm/eventpipe.h +++ b/src/vm/eventpipe.h @@ -8,6 +8,7 @@ #ifdef FEATURE_PERFTRACING #include "crst.h" +#include "eventpipeprovider.h" #include "stackwalk.h" class EventPipeConfiguration; @@ -174,6 +175,32 @@ class EventPipe static EventPipeJsonFile *s_pJsonFile; }; +class EventPipeInternal +{ + +public: + + static INT_PTR QCALLTYPE CreateProvider( + GUID providerID, + EventPipeCallback pCallbackFunc); + + static INT_PTR QCALLTYPE AddEvent( + INT_PTR provHandle, + __int64 keywords, + unsigned int eventID, + unsigned int eventVersion, + unsigned int level, + bool needStack); + + static void QCALLTYPE DeleteProvider( + INT_PTR provHandle); + + static void QCALLTYPE WriteEvent( + INT_PTR eventHandle, + void *pData, + unsigned int length); +}; + #endif // FEATURE_PERFTRACING #endif // __EVENTPIPE_H__ diff --git a/src/vm/eventpipeconfiguration.cpp b/src/vm/eventpipeconfiguration.cpp index cfb96fc..0128685 100644 --- a/src/vm/eventpipeconfiguration.cpp +++ b/src/vm/eventpipeconfiguration.cpp @@ -85,6 +85,7 @@ bool EventPipeConfiguration::RegisterProvider(EventPipeProvider &provider) // TODO: Set the provider configuration and enable it if we know // anything about the provider before it is registered. + provider.SetConfiguration(true /* providerEnabled */, 0xFFFFFFFFFFFFFFFF /* keywords */, EventPipeEventLevel::Verbose /* level */); return true; } diff --git a/src/vm/eventpipeprovider.cpp b/src/vm/eventpipeprovider.cpp index da18533..362c37a 100644 --- a/src/vm/eventpipeprovider.cpp +++ b/src/vm/eventpipeprovider.cpp @@ -10,7 +10,7 @@ #ifdef FEATURE_PERFTRACING -EventPipeProvider::EventPipeProvider(const GUID &providerID) +EventPipeProvider::EventPipeProvider(const GUID &providerID, EventPipeCallback pCallbackFunction, void *pCallbackData) { CONTRACTL { @@ -25,8 +25,8 @@ EventPipeProvider::EventPipeProvider(const GUID &providerID) m_keywords = 0; m_providerLevel = EventPipeEventLevel::Critical; m_pEventList = new SList>(); - m_pCallbackFunction = NULL; - m_pCallbackData = NULL; + m_pCallbackFunction = pCallbackFunction; + m_pCallbackData = pCallbackData; // Register the provider. EventPipeConfiguration* pConfig = EventPipe::GetConfiguration(); @@ -165,46 +165,6 @@ void EventPipeProvider::AddEvent(EventPipeEvent &event) m_pEventList->InsertTail(new SListElem(&event)); } -void EventPipeProvider::RegisterCallback(EventPipeCallback pCallbackFunction, void *pData) -{ - CONTRACTL - { - THROWS; - GC_NOTRIGGER; - MODE_ANY; - } - CONTRACTL_END; - - // Take the config lock before setting the callback. - CrstHolder _crst(EventPipe::GetLock()); - - if(m_pCallbackFunction == NULL) - { - m_pCallbackFunction = pCallbackFunction; - m_pCallbackData = pData; - } -} - -void EventPipeProvider::UnregisterCallback(EventPipeCallback pCallbackFunction) -{ - CONTRACTL - { - THROWS; - GC_NOTRIGGER; - MODE_ANY; - } - CONTRACTL_END; - - // Take the config lock before setting the callback. - CrstHolder _crst(EventPipe::GetLock()); - - if(m_pCallbackFunction == pCallbackFunction) - { - m_pCallbackFunction = NULL; - m_pCallbackData = NULL; - } -} - void EventPipeProvider::InvokeCallback() { CONTRACTL @@ -216,7 +176,7 @@ void EventPipeProvider::InvokeCallback() } CONTRACTL_END; - if(m_pCallbackFunction != NULL) + if(m_pCallbackFunction != NULL && !g_fEEShutDown) { (*m_pCallbackFunction)( &m_providerID, diff --git a/src/vm/eventpipeprovider.h b/src/vm/eventpipeprovider.h index 610d76d..d1ce158 100644 --- a/src/vm/eventpipeprovider.h +++ b/src/vm/eventpipeprovider.h @@ -61,7 +61,7 @@ private: public: - EventPipeProvider(const GUID &providerID); + EventPipeProvider(const GUID &providerID, EventPipeCallback pCallbackFunction = NULL, void *pCallbackData = NULL); ~EventPipeProvider(); // Get the provider ID. @@ -79,12 +79,6 @@ public: // Create a new event. EventPipeEvent* AddEvent(INT64 keywords, unsigned int eventID, unsigned int eventVersion, EventPipeEventLevel level, bool needStack); - // Register a callback with the provider to be called on state change. - void RegisterCallback(EventPipeCallback pCallbackFunction, void *pData); - - // Unregister a callback. - void UnregisterCallback(EventPipeCallback pCallbackFunction); - private: // Add an event to the provider. diff --git a/src/vm/mscorlib.cpp b/src/vm/mscorlib.cpp index d1f48bd..3e2d478 100644 --- a/src/vm/mscorlib.cpp +++ b/src/vm/mscorlib.cpp @@ -93,6 +93,7 @@ #if defined(FEATURE_EVENTSOURCE_XPLAT) #include "nativeeventsource.h" +#include "eventpipe.h" #endif //defined(FEATURE_EVENTSOURCE_XPLAT) #endif // CROSSGEN_MSCORLIB