From 2f4a95b3a4bc8c3a2b928eb59b7a88c5de84b4e9 Mon Sep 17 00:00:00 2001 From: Marek Safar Date: Fri, 1 Mar 2019 22:16:56 +0100 Subject: Remove unused code from EventSource (#22853) FallbackActivityId is theoretically references in CoreFX but it's under never defined FEATURE_ACTIVITYSAMPLING and the implementation should live in CoreFX part anyway --- .../System.Private.CoreLib.csproj | 1 - .../System/Diagnostics/Tracing/EventSource.cs | 33 ---------------------- .../System/Diagnostics/Tracing/StubEnvironment.cs | 3 -- 3 files changed, 37 deletions(-) (limited to 'src/System.Private.CoreLib') diff --git a/src/System.Private.CoreLib/System.Private.CoreLib.csproj b/src/System.Private.CoreLib/System.Private.CoreLib.csproj index afcfcf763f..df8bd2ac0b 100644 --- a/src/System.Private.CoreLib/System.Private.CoreLib.csproj +++ b/src/System.Private.CoreLib/System.Private.CoreLib.csproj @@ -269,7 +269,6 @@ - diff --git a/src/System.Private.CoreLib/shared/System/Diagnostics/Tracing/EventSource.cs b/src/System.Private.CoreLib/shared/System/Diagnostics/Tracing/EventSource.cs index fc5b26c32e..1f98dd55aa 100644 --- a/src/System.Private.CoreLib/shared/System/Diagnostics/Tracing/EventSource.cs +++ b/src/System.Private.CoreLib/shared/System/Diagnostics/Tracing/EventSource.cs @@ -434,39 +434,6 @@ namespace System.Diagnostics.Tracing eventSource.SendCommand(null, EventProviderType.ETW, 0, 0, command, true, EventLevel.LogAlways, EventKeywords.None, commandArguments); } -#if !ES_BUILD_STANDALONE - /// - /// This property allows EventSource code to appropriately handle as "different" - /// activities started on different threads that have not had an activity created on them. - /// - internal static Guid InternalCurrentThreadActivityId - { - get - { - Guid retval = CurrentThreadActivityId; - if (retval == Guid.Empty) - { - retval = FallbackActivityId; - } - return retval; - } - } - - internal static Guid FallbackActivityId - { - get - { - int threadID = Interop.Kernel32.GetCurrentThreadId(); - - // Managed thread IDs are more aggressively re-used than native thread IDs, - // so we'll use the latter... - return new Guid(unchecked((uint)threadID), - unchecked((ushort)s_currentPid), unchecked((ushort)(s_currentPid >> 16)), - 0x94, 0x1b, 0x87, 0xd5, 0xa6, 0x5c, 0x36, 0x64); - } - } -#endif // !ES_BUILD_STANDALONE - // Error APIs. (We don't throw by default, but you can probe for status) /// /// Because diff --git a/src/System.Private.CoreLib/shared/System/Diagnostics/Tracing/StubEnvironment.cs b/src/System.Private.CoreLib/shared/System/Diagnostics/Tracing/StubEnvironment.cs index 1ca8dd06a8..c62b517906 100644 --- a/src/System.Private.CoreLib/shared/System/Diagnostics/Tracing/StubEnvironment.cs +++ b/src/System.Private.CoreLib/shared/System/Diagnostics/Tracing/StubEnvironment.cs @@ -343,9 +343,6 @@ internal static partial class Interop [SuppressUnmanagedCodeSecurityAttribute()] internal static partial class Kernel32 { - [DllImport("kernel32.dll", CharSet = CharSet.Auto)] - public static extern int GetCurrentThreadId(); - [DllImport("kernel32.dll", CharSet = CharSet.Auto)] internal static extern uint GetCurrentProcessId(); } -- cgit v1.2.3