From: Brian Robbins Date: Thu, 11 May 2017 01:04:24 +0000 (-0700) Subject: Fix build. X-Git-Tag: accepted/tizen/base/20180629.140029~1109^2~56 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4a321d8000aa49e3a82f70467dfce2c1400089e3;p=platform%2Fupstream%2Fcoreclr.git Fix build. Signed-off-by: dotnet-bot --- diff --git a/src/mscorlib/shared/System/Diagnostics/Tracing/EventProvider.cs b/src/mscorlib/shared/System/Diagnostics/Tracing/EventProvider.cs index e5316bc..c8671db 100644 --- a/src/mscorlib/shared/System/Diagnostics/Tracing/EventProvider.cs +++ b/src/mscorlib/shared/System/Diagnostics/Tracing/EventProvider.cs @@ -124,6 +124,8 @@ namespace System.Diagnostics.Tracing m_eventProvider = new EtwEventProvider(); #elif FEATURE_PERFTRACING m_eventProvider = new EventPipeEventProvider(); +#else + m_eventProvider = new NoOpEventProvider(); #endif } @@ -475,7 +477,7 @@ namespace System.Diagnostics.Tracing providerInstance = (UnsafeNativeMethods.ManifestEtw.TRACE_PROVIDER_INSTANCE_INFO*)&structBase[providerInstance->NextOffset]; } #else -#if !ES_BUILD_PCL && !FEATURE_PAL // TODO command arguments don't work on PCL builds... +#if !ES_BUILD_PCL && PLATFORM_WINDOWS // TODO command arguments don't work on PCL builds... // This code is only used in the Nuget Package Version of EventSource. because // the code above is using APIs baned from UWP apps. // @@ -559,7 +561,7 @@ namespace System.Diagnostics.Tracing dataStart = 0; if (filterData == null) { -#if (!ES_BUILD_PCL && !ES_BUILD_PN && !FEATURE_PAL) +#if (!ES_BUILD_PCL && !ES_BUILD_PN && PLATFORM_WINDOWS) string regKey = @"\Microsoft\Windows\CurrentVersion\Winevt\Publishers\{" + m_providerId + "}"; if (System.Runtime.InteropServices.Marshal.SizeOf(typeof(IntPtr)) == 8) regKey = @"HKEY_LOCAL_MACHINE\Software" + @"\Wow6432Node" + regKey; @@ -1262,6 +1264,41 @@ namespace System.Diagnostics.Tracing } } +#elif !FEATURE_PERFTRACING + + internal sealed class NoOpEventProvider : IEventProvider + { + unsafe uint IEventProvider.EventRegister( + ref Guid providerId, + UnsafeNativeMethods.ManifestEtw.EtwEnableCallback enableCallback, + void* callbackContext, + ref long registrationHandle) + { + return 0; + } + + uint IEventProvider.EventUnregister(long registrationHandle) + { + return 0; + } + + unsafe int IEventProvider.EventWriteTransferWrapper( + long registrationHandle, + ref EventDescriptor eventDescriptor, + Guid* activityId, + Guid* relatedActivityId, + int userDataCount, + EventProvider.EventData* userData) + { + return 0; + } + + int IEventProvider.EventActivityIdControl(UnsafeNativeMethods.ManifestEtw.ActivityControl ControlCode, ref Guid ActivityId) + { + return 0; + } + } + #endif } diff --git a/src/mscorlib/shared/System/Diagnostics/Tracing/EventSource.cs b/src/mscorlib/shared/System/Diagnostics/Tracing/EventSource.cs index 483b1f8..440e758 100644 --- a/src/mscorlib/shared/System/Diagnostics/Tracing/EventSource.cs +++ b/src/mscorlib/shared/System/Diagnostics/Tracing/EventSource.cs @@ -4,7 +4,7 @@ // 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 !ES_BUILD_STANDALONE && !CORECLR && !ES_BUILD_PN +#if PLATFORM_WINDOWS && !ES_BUILD_STANDALONE && !CORECLR && !ES_BUILD_PN #define FEATURE_ACTIVITYSAMPLING #endif // !ES_BUILD_STANDALONE