From: Brian Robbins Date: Sat, 13 May 2017 18:39:10 +0000 (-0700) Subject: Disable ETW calls on UNIX. X-Git-Tag: accepted/tizen/base/20180629.140029~1109^2~35^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e029e54d6d5bfe6a886a761c77eb3f66c3131ac9;p=platform%2Fupstream%2Fcoreclr.git Disable ETW calls on UNIX. --- diff --git a/src/mscorlib/shared/System/Diagnostics/Tracing/EventSource.cs b/src/mscorlib/shared/System/Diagnostics/Tracing/EventSource.cs index 440e758..513366f 100644 --- a/src/mscorlib/shared/System/Diagnostics/Tracing/EventSource.cs +++ b/src/mscorlib/shared/System/Diagnostics/Tracing/EventSource.cs @@ -1468,7 +1468,8 @@ namespace System.Diagnostics.Tracing // Set m_provider, which allows this. m_provider = provider; -#if (!ES_BUILD_STANDALONE && !ES_BUILD_PN && !PLATFORM_UNIX) +#if PLATFORM_WINDOWS +#if (!ES_BUILD_STANDALONE && !ES_BUILD_PN) // 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) @@ -1486,6 +1487,7 @@ namespace System.Diagnostics.Tracing metadataHandle.Free(); } +#endif // PLATFORM_WINDOWS #endif // FEATURE_MANAGED_ETW Debug.Assert(!m_eventSourceEnabled); // We can't be enabled until we are completely initted. diff --git a/src/mscorlib/src/System/Diagnostics/Eventing/EventSource_CoreCLR.cs b/src/mscorlib/src/System/Diagnostics/Eventing/EventSource_CoreCLR.cs index bf9e038..a41c069 100644 --- a/src/mscorlib/src/System/Diagnostics/Eventing/EventSource_CoreCLR.cs +++ b/src/mscorlib/src/System/Diagnostics/Eventing/EventSource_CoreCLR.cs @@ -82,14 +82,14 @@ namespace System.Diagnostics.Tracing public static void SetCurrentThreadActivityId(Guid activityId, out Guid oldActivityThatWillContinue) { oldActivityThatWillContinue = activityId; -#if FEATURE_MANAGED_ETW +#if FEATURE_MANAGED_ETW && PLATFORM_WINDOWS // We ignore errors to keep with the convention that EventSources do not throw errors. // Note we can't access m_throwOnWrites because this is a static method. UnsafeNativeMethods.ManifestEtw.EventActivityIdControl( UnsafeNativeMethods.ManifestEtw.ActivityControl.EVENT_ACTIVITY_CTRL_GET_SET_ID, ref oldActivityThatWillContinue); -#endif // FEATURE_MANAGED_ETW +#endif // FEATURE_MANAGED_ETW && PLATFORM_WINDOWS // We don't call the activityDying callback here because the caller has declared that // it is not dying. @@ -107,11 +107,11 @@ namespace System.Diagnostics.Tracing // We ignore errors to keep with the convention that EventSources do not throw // errors. Note we can't access m_throwOnWrites because this is a static method. Guid retVal = new Guid(); -#if FEATURE_MANAGED_ETW +#if FEATURE_MANAGED_ETW && PLATFORM_WINDOWS UnsafeNativeMethods.ManifestEtw.EventActivityIdControl( UnsafeNativeMethods.ManifestEtw.ActivityControl.EVENT_ACTIVITY_CTRL_GET_ID, ref retVal); -#endif // FEATURE_MANAGED_ETW +#endif // FEATURE_MANAGED_ETW && PLATFORM_WINDOWS return retVal; } }