diff --git a/src/inc/eventtracebase.h b/src/inc/eventtracebase.h index 82332b54374d..75eb89209c6e 100644 --- a/src/inc/eventtracebase.h +++ b/src/inc/eventtracebase.h @@ -240,7 +240,7 @@ extern BOOL g_fEEIJWStartup; } }; -#endif //defined(FEATURE_EVENT_TRACE) +#endif //defined(FEATURE_EVENT_TRACE) || defined(FEATURE_EVENTSOURCE_XPLAT) #if defined(FEATURE_EVENT_TRACE) diff --git a/src/mscorlib/mscorlib.shared.sources.props b/src/mscorlib/mscorlib.shared.sources.props index d865f1a75c50..547b2146ca8a 100644 --- a/src/mscorlib/mscorlib.shared.sources.props +++ b/src/mscorlib/mscorlib.shared.sources.props @@ -858,7 +858,7 @@ - + diff --git a/src/mscorlib/src/System/Diagnostics/Eventing/EventSource.cs b/src/mscorlib/src/System/Diagnostics/Eventing/EventSource.cs index be72b547603c..6b31f4b9af5b 100644 --- a/src/mscorlib/src/System/Diagnostics/Eventing/EventSource.cs +++ b/src/mscorlib/src/System/Diagnostics/Eventing/EventSource.cs @@ -251,9 +251,9 @@ namespace System.Diagnostics.Tracing public partial class EventSource : IDisposable { -#if FEATURE_EVENTSOURCE_XPLAT +#if FEATURE_PAL private static readonly EventListener persistent_Xplat_Listener = XplatEventLogger.InitializePersistentListener(); -#endif //FEATURE_EVENTSOURCE_XPLAT +#endif //FEATURE_PAL /// /// The human-friendly name of the eventSource. It defaults to the simple name of the class diff --git a/src/mscorlib/src/System/Diagnostics/Eventing/XplatEventLogger.cs b/src/mscorlib/src/System/Diagnostics/Eventing/XplatEventLogger.cs index 4e380ee5e427..e5945dae9b7c 100644 --- a/src/mscorlib/src/System/Diagnostics/Eventing/XplatEventLogger.cs +++ b/src/mscorlib/src/System/Diagnostics/Eventing/XplatEventLogger.cs @@ -8,7 +8,7 @@ using Contract = System.Diagnostics.Contracts.Contract; -#if FEATURE_EVENTSOURCE_XPLAT +#if FEATURE_PAL namespace System.Diagnostics.Tracing { @@ -149,4 +149,4 @@ private void LogOnEventWritten(EventWrittenEventArgs eventData) } } } -#endif //FEATURE_EVENTSOURCE_XPLAT +#endif //FEATURE_PAL diff --git a/src/vm/ecalllist.h b/src/vm/ecalllist.h index 2966ab5dbe52..aa53df80343d 100644 --- a/src/vm/ecalllist.h +++ b/src/vm/ecalllist.h @@ -2091,12 +2091,12 @@ FCFuncStart(gWindowsRuntimeBufferHelperFuncs) FCFuncEnd() #endif // ifdef FEATURE_COMINTEROP -#if defined(FEATURE_EVENTSOURCE_XPLAT) +#ifdef FEATURE_PAL FCFuncStart(gEventLogger) QCFuncElement("IsEventSourceLoggingEnabled", XplatEventSourceLogger::IsEventSourceLoggingEnabled) QCFuncElement("LogEventSource", XplatEventSourceLogger::LogEventSource) FCFuncEnd() -#endif // defined(FEATURE_EVENTSOURCE_XPLAT) +#endif //FEATURE_PAL #ifdef FEATURE_COMINTEROP FCFuncStart(gRuntimeClassFuncs) @@ -2490,9 +2490,9 @@ FCClassElement("WindowsRuntimeMetadata", "System.Runtime.InteropServices.Windows #ifdef FEATURE_X509 FCClassElement("X509Utils", "System.Security.Cryptography.X509Certificates", gX509CertificateFuncs) #endif // FEATURE_X509 -#if defined(FEATURE_EVENTSOURCE_XPLAT) +#ifdef FEATURE_PAL FCClassElement("XplatEventLogger", "System.Diagnostics.Tracing", gEventLogger) -#endif //defined(FEATURE_EVENTSOURCE_XPLAT) +#endif //FEATURE_PAL #ifdef FEATURE_CAS_POLICY FCClassElement("Zone", "System.Security.Policy", gCOMSecurityZone) #endif // FEATURE_CAS_POLICY diff --git a/src/vm/eventtracepriv.h b/src/vm/eventtracepriv.h index 6b2a26672885..ba774a7659d0 100644 --- a/src/vm/eventtracepriv.h +++ b/src/vm/eventtracepriv.h @@ -408,13 +408,20 @@ class BulkStaticsLogger #endif // __EVENTTRACEPRIV_H__ -#if defined(FEATURE_EVENTSOURCE_XPLAT) +#ifdef FEATURE_PAL + class XplatEventSourceLogger { public: +#ifdef FEATURE_EVENTSOURCE_XPLAT static void QCALLTYPE LogEventSource(__in_z int eventID, __in_z LPCWSTR eventName, __in_z LPCWSTR eventSourceName, __in_z LPCWSTR payload); - static BOOL QCALLTYPE IsEventSourceLoggingEnabled(); +#else + static void QCALLTYPE LogEventSource(__in_z int eventID, __in_z LPCWSTR eventName, __in_z LPCWSTR eventSourceName, __in_z LPCWSTR payload) {}; + static BOOL QCALLTYPE IsEventSourceLoggingEnabled() { return false; }; +#endif + + }; -#endif //defined(FEATURE_EVENTSOURCE_XPLAT) +#endif // FEATURE_PAL diff --git a/src/vm/mscorlib.cpp b/src/vm/mscorlib.cpp index 1ba20944c954..f20e6b3f0f99 100644 --- a/src/vm/mscorlib.cpp +++ b/src/vm/mscorlib.cpp @@ -130,12 +130,12 @@ #include "windowsruntimebufferhelper.h" #endif -#if defined(FEATURE_EVENTSOURCE_XPLAT) - +#ifdef FEATURE_PAL +// Only include definition for XplatEventSourceLogger #define __EVENTTRACEPRIV_H__ #include "eventtracepriv.h" #undef __EVENTTRACEPRIV_H__ -#endif //defined(FEATURE_EVENTSOURCE_XPLAT) +#endif // FEATURE_PAL #endif // CROSSGEN_MSCORLIB