Delete ENABLE_REFLECTION_TRACE (#70244)
authorJan Kotas <jkotas@microsoft.com>
Mon, 6 Jun 2022 00:57:23 +0000 (17:57 -0700)
committerGitHub <noreply@github.com>
Mon, 6 Jun 2022 00:57:23 +0000 (09:57 +0900)
33 files changed:
src/coreclr/nativeaot/System.Private.Reflection.Core/src/Internal/Reflection/Tracing/ITraceableTypeMember.cs [deleted file]
src/coreclr/nativeaot/System.Private.Reflection.Core/src/System.Private.Reflection.Core.csproj
src/coreclr/nativeaot/System.Private.Reflection.Core/src/System/Reflection/Runtime/Assemblies/NativeFormat/NativeFormatRuntimeAssembly.GetTypeCore.CaseInsensitive.cs
src/coreclr/nativeaot/System.Private.Reflection.Core/src/System/Reflection/Runtime/Assemblies/NativeFormat/NativeFormatRuntimeAssembly.GetTypeCore.CaseSensitive.cs
src/coreclr/nativeaot/System.Private.Reflection.Core/src/System/Reflection/Runtime/Assemblies/NativeFormat/NativeFormatRuntimeAssembly.cs
src/coreclr/nativeaot/System.Private.Reflection.Core/src/System/Reflection/Runtime/Assemblies/RuntimeAssemblyInfo.cs
src/coreclr/nativeaot/System.Private.Reflection.Core/src/System/Reflection/Runtime/CustomAttributes/RuntimeCustomAttributeData.cs
src/coreclr/nativeaot/System.Private.Reflection.Core/src/System/Reflection/Runtime/EventInfos/NativeFormat/NativeFormatRuntimeEventInfo.cs
src/coreclr/nativeaot/System.Private.Reflection.Core/src/System/Reflection/Runtime/EventInfos/RuntimeEventInfo.cs
src/coreclr/nativeaot/System.Private.Reflection.Core/src/System/Reflection/Runtime/FieldInfos/NativeFormat/NativeFormatRuntimeFieldInfo.cs
src/coreclr/nativeaot/System.Private.Reflection.Core/src/System/Reflection/Runtime/FieldInfos/RuntimeFieldInfo.cs
src/coreclr/nativeaot/System.Private.Reflection.Core/src/System/Reflection/Runtime/MethodInfos/RuntimeConstructorInfo.cs
src/coreclr/nativeaot/System.Private.Reflection.Core/src/System/Reflection/Runtime/MethodInfos/RuntimeMethodInfo.cs
src/coreclr/nativeaot/System.Private.Reflection.Core/src/System/Reflection/Runtime/MethodInfos/RuntimeNamedMethodInfo.cs
src/coreclr/nativeaot/System.Private.Reflection.Core/src/System/Reflection/Runtime/MethodInfos/RuntimePlainConstructorInfo.cs
src/coreclr/nativeaot/System.Private.Reflection.Core/src/System/Reflection/Runtime/PropertyInfos/EcmaFormat/EcmaFormatRuntimePropertyInfo.cs
src/coreclr/nativeaot/System.Private.Reflection.Core/src/System/Reflection/Runtime/PropertyInfos/NativeFormat/NativeFormatRuntimePropertyInfo.cs
src/coreclr/nativeaot/System.Private.Reflection.Core/src/System/Reflection/Runtime/PropertyInfos/RuntimePropertyInfo.cs
src/coreclr/nativeaot/System.Private.Reflection.Core/src/System/Reflection/Runtime/Tracing/ReflectionEventSource.cs [deleted file]
src/coreclr/nativeaot/System.Private.Reflection.Core/src/System/Reflection/Runtime/TypeInfos/NativeFormat/NativeFormatRuntimeGenericParameterTypeInfo.cs
src/coreclr/nativeaot/System.Private.Reflection.Core/src/System/Reflection/Runtime/TypeInfos/NativeFormat/NativeFormatRuntimeGenericParameterTypeInfoForMethods.UnificationKey.cs
src/coreclr/nativeaot/System.Private.Reflection.Core/src/System/Reflection/Runtime/TypeInfos/NativeFormat/NativeFormatRuntimeGenericParameterTypeInfoForMethods.cs
src/coreclr/nativeaot/System.Private.Reflection.Core/src/System/Reflection/Runtime/TypeInfos/NativeFormat/NativeFormatRuntimeGenericParameterTypeInfoForTypes.UnificationKey.cs
src/coreclr/nativeaot/System.Private.Reflection.Core/src/System/Reflection/Runtime/TypeInfos/NativeFormat/NativeFormatRuntimeGenericParameterTypeInfoForTypes.cs
src/coreclr/nativeaot/System.Private.Reflection.Core/src/System/Reflection/Runtime/TypeInfos/NativeFormat/NativeFormatRuntimeNamedTypeInfo.cs
src/coreclr/nativeaot/System.Private.Reflection.Core/src/System/Reflection/Runtime/TypeInfos/RuntimeBlockedTypeInfo.cs
src/coreclr/nativeaot/System.Private.Reflection.Core/src/System/Reflection/Runtime/TypeInfos/RuntimeClsIdTypeInfo.cs
src/coreclr/nativeaot/System.Private.Reflection.Core/src/System/Reflection/Runtime/TypeInfos/RuntimeConstructedGenericTypeInfo.cs
src/coreclr/nativeaot/System.Private.Reflection.Core/src/System/Reflection/Runtime/TypeInfos/RuntimeGenericParameterTypeInfo.cs
src/coreclr/nativeaot/System.Private.Reflection.Core/src/System/Reflection/Runtime/TypeInfos/RuntimeHasElementTypeInfo.cs
src/coreclr/nativeaot/System.Private.Reflection.Core/src/System/Reflection/Runtime/TypeInfos/RuntimeNamedTypeInfo.cs
src/coreclr/nativeaot/System.Private.Reflection.Core/src/System/Reflection/Runtime/TypeInfos/RuntimeNoMetadataNamedTypeInfo.cs
src/coreclr/nativeaot/System.Private.Reflection.Core/src/System/Reflection/Runtime/TypeInfos/RuntimeTypeInfo.cs

diff --git a/src/coreclr/nativeaot/System.Private.Reflection.Core/src/Internal/Reflection/Tracing/ITraceableTypeMember.cs b/src/coreclr/nativeaot/System.Private.Reflection.Core/src/Internal/Reflection/Tracing/ITraceableTypeMember.cs
deleted file mode 100644 (file)
index c3a35e3..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
-using System;
-using System.Reflection;
-using System.Diagnostics;
-
-namespace Internal.Reflection.Tracing
-{
-    internal interface ITraceableTypeMember
-    {
-        // Returns the Name value *without recursing into the public Name implementation.*
-        string MemberName { get; }
-
-        // Returns the DeclaringType value *without recursing into the public DeclaringType implementation.*
-        Type ContainingType { get; }
-    }
-}
index 3ac7aed..a770233 100644 (file)
     <Compile Include="System\Reflection\Runtime\ParameterInfos\RuntimeSyntheticParameterInfo.cs" />
     <Compile Include="System\Reflection\Runtime\PropertyInfos\NativeFormat\NativeFormatRuntimePropertyInfo.cs" />
     <Compile Include="System\Reflection\Runtime\PropertyInfos\RuntimePropertyInfo.cs" />
-    <Compile Include="System\Reflection\Runtime\Tracing\ReflectionEventSource.cs" />
     <Compile Include="System\Reflection\Runtime\TypeInfos\NativeFormat\NativeFormatRuntimeNamedTypeInfo.cs" />
     <Compile Include="System\Reflection\Runtime\TypeInfos\NativeFormat\NativeFormatRuntimeGenericParameterTypeInfo.cs" />
     <Compile Include="System\Reflection\Runtime\TypeInfos\NativeFormat\NativeFormatRuntimeNamedTypeInfo.UnificationKey.cs" />
     <Compile Include="Internal\Reflection\Core\Execution\ReflectionCoreExecution.cs" />
   </ItemGroup>
   <ItemGroup>
-    <Compile Include="Internal\Reflection\Tracing\ITraceableTypeMember.cs" />
-  </ItemGroup>
-  <ItemGroup>
     <Compile Include="$(CommonPath)\System\NotImplemented.cs">
       <Link>System\NotImplemented.cs</Link>
     </Compile>
index a6450ef..81cf4e7 100644 (file)
@@ -21,7 +21,6 @@ using System.Collections.Generic;
 using Internal.Reflection.Core;
 using Internal.Reflection.Core.Execution;
 using Internal.Metadata.NativeFormat;
-using Internal.Reflection.Tracing;
 
 namespace System.Reflection.Runtime.Assemblies.NativeFormat
 {
@@ -37,11 +36,6 @@ namespace System.Reflection.Runtime.Assemblies.NativeFormat
         {
             get
             {
-#if ENABLE_REFLECTION_TRACE
-                if (ReflectionTrace.Enabled)
-                    ReflectionTrace.Assembly_CustomAttributes(this);
-#endif
-
                 foreach (QScopeDefinition scope in AllScopes)
                 {
                     foreach (CustomAttributeData cad in RuntimeCustomAttributeData.GetCustomAttributes(scope.Reader, scope.ScopeDefinition.CustomAttributes))
@@ -55,11 +49,6 @@ namespace System.Reflection.Runtime.Assemblies.NativeFormat
             [RequiresUnreferencedCode("Types might be removed")]
             get
             {
-#if ENABLE_REFLECTION_TRACE
-                if (ReflectionTrace.Enabled)
-                    ReflectionTrace.Assembly_DefinedTypes(this);
-#endif
-
                 foreach (QScopeDefinition scope in AllScopes)
                 {
                     MetadataReader reader = scope.Reader;
index 88b9443..c2d2c47 100644 (file)
@@ -20,7 +20,6 @@ using Internal.Reflection.Core;
 using Internal.Reflection.Core.Execution;
 using Internal.Reflection.Core.NonPortable;
 
-using Internal.Reflection.Tracing;
 using System.Security;
 
 namespace System.Reflection.Runtime.Assemblies
@@ -42,11 +41,6 @@ namespace System.Reflection.Runtime.Assemblies
         {
             get
             {
-#if ENABLE_REFLECTION_TRACE
-                if (ReflectionTrace.Enabled)
-                    ReflectionTrace.Assembly_FullName(this);
-#endif
-
                 return GetName().FullName;
             }
         }
@@ -77,11 +71,6 @@ namespace System.Reflection.Runtime.Assemblies
         [RequiresUnreferencedCode("Types might be removed")]
         public sealed override Type GetType(string name, bool throwOnError, bool ignoreCase)
         {
-#if ENABLE_REFLECTION_TRACE
-            if (ReflectionTrace.Enabled)
-                ReflectionTrace.Assembly_GetType(this, name);
-#endif
-
             if (name == null)
                 throw new ArgumentNullException();
             if (name.Length == 0)
@@ -124,10 +113,6 @@ namespace System.Reflection.Runtime.Assemblies
 
         public sealed override AssemblyName GetName()
         {
-#if ENABLE_REFLECTION_TRACE
-            if (ReflectionTrace.Enabled)
-                ReflectionTrace.Assembly_GetName(this);
-#endif
             return RuntimeAssemblyName.ToAssemblyName();
         }
 
index 555277b..867a447 100644 (file)
@@ -6,8 +6,6 @@ using System.Collections.Generic;
 using System.Collections.ObjectModel;
 using System.Diagnostics.CodeAnalysis;
 
-using Internal.Reflection.Tracing;
-
 namespace System.Reflection.Runtime.CustomAttributes
 {
     //
@@ -23,11 +21,6 @@ namespace System.Reflection.Runtime.CustomAttributes
         {
             get
             {
-#if ENABLE_REFLECTION_TRACE
-                if (ReflectionTrace.Enabled)
-                    ReflectionTrace.CustomAttributeData_ConstructorArguments(this);
-#endif
-
                 return new ReadOnlyCollection<CustomAttributeTypedArgument>(GetConstructorArguments(throwIfMissingMetadata: true));
             }
         }
@@ -38,11 +31,6 @@ namespace System.Reflection.Runtime.CustomAttributes
         {
             get
             {
-#if ENABLE_REFLECTION_TRACE
-                if (ReflectionTrace.Enabled)
-                    ReflectionTrace.CustomAttributeData_NamedArguments(this);
-#endif
-
                 return new ReadOnlyCollection<CustomAttributeNamedArgument>(GetNamedArguments(throwIfMissingMetadata: true));
             }
         }
index 60f842a..9317d38 100644 (file)
@@ -18,7 +18,6 @@ using Internal.Metadata.NativeFormat;
 using NativeFormatMethodSemanticsAttributes = global::Internal.Metadata.NativeFormat.MethodSemanticsAttributes;
 
 using Internal.Reflection.Core.Execution;
-using Internal.Reflection.Tracing;
 
 namespace System.Reflection.Runtime.EventInfos.NativeFormat
 {
@@ -98,11 +97,6 @@ namespace System.Reflection.Runtime.EventInfos.NativeFormat
         {
             get
             {
-#if ENABLE_REFLECTION_TRACE
-                if (ReflectionTrace.Enabled)
-                    ReflectionTrace.EventInfo_CustomAttributes(this);
-#endif
-
                 return RuntimeCustomAttributeData.GetCustomAttributes(_reader, _event.CustomAttributes);
             }
         }
index c99e630..bb46778 100644 (file)
@@ -12,7 +12,6 @@ using System.Reflection.Runtime.ParameterInfos;
 using System.Reflection.Runtime.CustomAttributes;
 
 using Internal.Reflection.Core.Execution;
-using Internal.Reflection.Tracing;
 
 namespace System.Reflection.Runtime.EventInfos
 {
@@ -20,7 +19,7 @@ namespace System.Reflection.Runtime.EventInfos
     // The runtime's implementation of EventInfo's
     //
     [DebuggerDisplay("{_debugName}")]
-    internal abstract partial class RuntimeEventInfo : EventInfo, ITraceableTypeMember
+    internal abstract partial class RuntimeEventInfo : EventInfo
     {
         protected RuntimeEventInfo(RuntimeTypeInfo contextTypeInfo, RuntimeTypeInfo reflectedType)
         {
@@ -32,11 +31,6 @@ namespace System.Reflection.Runtime.EventInfos
         {
             get
             {
-#if ENABLE_REFLECTION_TRACE
-                if (ReflectionTrace.Enabled)
-                    ReflectionTrace.EventInfo_AddMethod(this);
-#endif
-
                 MethodInfo adder = _lazyAdder;
                 if (adder == null)
                 {
@@ -54,11 +48,6 @@ namespace System.Reflection.Runtime.EventInfos
         {
             get
             {
-#if ENABLE_REFLECTION_TRACE
-                if (ReflectionTrace.Enabled)
-                    ReflectionTrace.EventInfo_DeclaringType(this);
-#endif
-
                 return ContextTypeInfo;
             }
         }
@@ -82,11 +71,6 @@ namespace System.Reflection.Runtime.EventInfos
         {
             get
             {
-#if ENABLE_REFLECTION_TRACE
-                if (ReflectionTrace.Enabled)
-                    ReflectionTrace.EventInfo_Name(this);
-#endif
-
                 return MetadataName;
             }
         }
@@ -103,11 +87,6 @@ namespace System.Reflection.Runtime.EventInfos
         {
             get
             {
-#if ENABLE_REFLECTION_TRACE
-                if (ReflectionTrace.Enabled)
-                    ReflectionTrace.EventInfo_RaiseMethod(this);
-#endif
-
                 return GetEventMethod(EventMethodSemantics.Fire);
             }
         }
@@ -116,11 +95,6 @@ namespace System.Reflection.Runtime.EventInfos
         {
             get
             {
-#if ENABLE_REFLECTION_TRACE
-                if (ReflectionTrace.Enabled)
-                    ReflectionTrace.EventInfo_RemoveMethod(this);
-#endif
-
                 MethodInfo remover = _lazyRemover;
                 if (remover == null)
                 {
@@ -144,22 +118,6 @@ namespace System.Reflection.Runtime.EventInfos
             return runtimeParameterInfo.ParameterTypeString + " " + this.Name;
         }
 
-        string ITraceableTypeMember.MemberName
-        {
-            get
-            {
-                return MetadataName;
-            }
-        }
-
-        Type ITraceableTypeMember.ContainingType
-        {
-            get
-            {
-                return ContextTypeInfo;
-            }
-        }
-
         protected RuntimeEventInfo WithDebugName()
         {
             bool populateDebugNames = DeveloperExperienceState.DeveloperExperienceModeEnabled;
index b676005..098f960 100644 (file)
@@ -17,15 +17,13 @@ using System.Reflection.Runtime.BindingFlagSupport;
 using Internal.Reflection.Core;
 using Internal.Reflection.Core.Execution;
 
-using Internal.Reflection.Tracing;
-
 namespace System.Reflection.Runtime.FieldInfos
 {
     //
     // The Runtime's implementation of fields.
     //
     [DebuggerDisplay("{_debugName}")]
-    internal abstract partial class RuntimeFieldInfo : FieldInfo, ITraceableTypeMember
+    internal abstract partial class RuntimeFieldInfo : FieldInfo
     {
         //
         // contextType    - the type that supplies the type context (i.e. substitutions for generic parameters.) Though you
@@ -54,11 +52,6 @@ namespace System.Reflection.Runtime.FieldInfos
         {
             get
             {
-#if ENABLE_REFLECTION_TRACE
-                if (ReflectionTrace.Enabled)
-                    ReflectionTrace.FieldInfo_CustomAttributes(this);
-#endif
-
                 foreach (CustomAttributeData cad in TrueCustomAttributes)
                     yield return cad;
 
@@ -81,11 +74,6 @@ namespace System.Reflection.Runtime.FieldInfos
         {
             get
             {
-#if ENABLE_REFLECTION_TRACE
-                if (ReflectionTrace.Enabled)
-                    ReflectionTrace.FieldInfo_DeclaringType(this);
-#endif
-
                 return _contextTypeInfo;
             }
         }
@@ -110,11 +98,6 @@ namespace System.Reflection.Runtime.FieldInfos
 
         public sealed override object GetValue(object obj)
         {
-#if ENABLE_REFLECTION_TRACE
-            if (ReflectionTrace.Enabled)
-                ReflectionTrace.FieldInfo_GetValue(this, obj);
-#endif
-
             FieldAccessor fieldAccessor = this.FieldAccessor;
             return fieldAccessor.GetField(obj);
         }
@@ -148,11 +131,6 @@ namespace System.Reflection.Runtime.FieldInfos
 
         public sealed override void SetValue(object obj, object value, BindingFlags invokeAttr, Binder binder, CultureInfo culture)
         {
-#if ENABLE_REFLECTION_TRACE
-            if (ReflectionTrace.Enabled)
-                ReflectionTrace.FieldInfo_SetValue(this, obj, value);
-#endif
-
             FieldAccessor fieldAccessor = this.FieldAccessor;
             BinderBundle binderBundle = binder.ToBinderBundle(invokeAttr, culture);
             fieldAccessor.SetField(obj, value, binderBundle);
@@ -167,14 +145,6 @@ namespace System.Reflection.Runtime.FieldInfos
             fieldAccessor.SetFieldDirect(obj, value);
         }
 
-        Type ITraceableTypeMember.ContainingType
-        {
-            get
-            {
-                return _contextTypeInfo;
-            }
-        }
-
         /// <summary>
         /// Override to provide the metadata based name of a field. (Different from the Name
         /// property in that it does not go into the reflection trace logic.)
@@ -185,19 +155,6 @@ namespace System.Reflection.Runtime.FieldInfos
         {
             get
             {
-#if ENABLE_REFLECTION_TRACE
-                if (ReflectionTrace.Enabled)
-                    ReflectionTrace.FieldInfo_Name(this);
-#endif
-
-                return MetadataName;
-            }
-        }
-
-        string ITraceableTypeMember.MemberName
-        {
-            get
-            {
                 return MetadataName;
             }
         }
@@ -280,7 +237,7 @@ namespace System.Reflection.Runtime.FieldInfos
             if (_debugName == null)
             {
                 _debugName = "Constructing..."; // Protect against any inadvertent reentrancy.
-                _debugName = ((ITraceableTypeMember)this).MemberName;
+                _debugName = MetadataName;
             }
             return this;
         }
index 7880071..708e25c 100644 (file)
@@ -13,8 +13,6 @@ using System.Reflection.Runtime.ParameterInfos;
 
 using Internal.Reflection.Core.Execution;
 
-using Internal.Reflection.Tracing;
-
 namespace System.Reflection.Runtime.MethodInfos
 {
     //
@@ -52,11 +50,6 @@ namespace System.Reflection.Runtime.MethodInfos
 
         public sealed override ParameterInfo[] GetParameters()
         {
-#if ENABLE_REFLECTION_TRACE
-            if (ReflectionTrace.Enabled)
-                ReflectionTrace.MethodBase_GetParameters(this);
-#endif
-
             RuntimeParameterInfo[] parameters = RuntimeParameters;
             if (parameters.Length == 0)
                 return Array.Empty<ParameterInfo>();
@@ -78,10 +71,6 @@ namespace System.Reflection.Runtime.MethodInfos
         [DebuggerGuidedStepThrough]
         public sealed override object Invoke(object obj, BindingFlags invokeAttr, Binder binder, object[] parameters, CultureInfo culture)
         {
-#if ENABLE_REFLECTION_TRACE
-            if (ReflectionTrace.Enabled)
-                ReflectionTrace.MethodBase_Invoke(this, obj, parameters);
-#endif
             if (parameters == null)
                 parameters = Array.Empty<object>();
             MethodInvoker methodInvoker;
index 27705d3..3d9fc96 100644 (file)
@@ -14,7 +14,6 @@ using System.Reflection.Runtime.ParameterInfos;
 using System.Reflection.Runtime.BindingFlagSupport;
 
 using Internal.Reflection.Core.Execution;
-using Internal.Reflection.Tracing;
 
 namespace System.Reflection.Runtime.MethodInfos
 {
@@ -22,7 +21,7 @@ namespace System.Reflection.Runtime.MethodInfos
     // Abstract base class for RuntimeNamedMethodInfo, RuntimeConstructedGenericMethodInfo.
     //
     [DebuggerDisplay("{_debugName}")]
-    internal abstract partial class RuntimeMethodInfo : MethodInfo, ITraceableTypeMember
+    internal abstract partial class RuntimeMethodInfo : MethodInfo
     {
         protected RuntimeMethodInfo()
         {
@@ -62,22 +61,12 @@ namespace System.Reflection.Runtime.MethodInfos
         // V4.5 api - Creates open delegates over static or instance methods.
         public sealed override Delegate CreateDelegate(Type delegateType)
         {
-#if ENABLE_REFLECTION_TRACE
-            if (ReflectionTrace.Enabled)
-                ReflectionTrace.MethodInfo_CreateDelegate(this, delegateType);
-#endif
-
             return CreateDelegateWorker(delegateType, null, allowClosed: false);
         }
 
         // V4.5 api - Creates open or closed delegates over static or instance methods.
         public sealed override Delegate CreateDelegate(Type delegateType, object target)
         {
-#if ENABLE_REFLECTION_TRACE
-            if (ReflectionTrace.Enabled)
-                ReflectionTrace.MethodInfo_CreateDelegate(this, delegateType, target);
-#endif
-
             return CreateDelegateWorker(delegateType, target, allowClosed: true);
         }
 
@@ -107,11 +96,6 @@ namespace System.Reflection.Runtime.MethodInfos
         {
             get
             {
-#if ENABLE_REFLECTION_TRACE
-                if (ReflectionTrace.Enabled)
-                    ReflectionTrace.MethodBase_DeclaringType(this);
-#endif
-
                 return this.RuntimeDeclaringType;
             }
         }
@@ -160,11 +144,6 @@ namespace System.Reflection.Runtime.MethodInfos
 
         public sealed override ParameterInfo[] GetParameters()
         {
-#if ENABLE_REFLECTION_TRACE
-            if (ReflectionTrace.Enabled)
-                ReflectionTrace.MethodBase_GetParameters(this);
-#endif
-
             RuntimeParameterInfo[] runtimeParameterInfos = RuntimeParameters;
             if (runtimeParameterInfos.Length == 0)
                 return Array.Empty<ParameterInfo>();
@@ -184,10 +163,6 @@ namespace System.Reflection.Runtime.MethodInfos
         [DebuggerGuidedStepThroughAttribute]
         public sealed override object Invoke(object obj, BindingFlags invokeAttr, Binder binder, object[] parameters, CultureInfo culture)
         {
-#if ENABLE_REFLECTION_TRACE
-            if (ReflectionTrace.Enabled)
-                ReflectionTrace.MethodBase_Invoke(this, obj, parameters);
-#endif
             if (parameters == null)
                 parameters = Array.Empty<object>();
             MethodInvoker methodInvoker = this.MethodInvoker;
@@ -236,10 +211,6 @@ namespace System.Reflection.Runtime.MethodInfos
         {
             get
             {
-#if ENABLE_REFLECTION_TRACE
-                if (ReflectionTrace.Enabled)
-                    ReflectionTrace.MethodBase_Name(this);
-#endif
                 return this.RuntimeName;
             }
         }
@@ -250,11 +221,6 @@ namespace System.Reflection.Runtime.MethodInfos
         {
             get
             {
-#if ENABLE_REFLECTION_TRACE
-                if (ReflectionTrace.Enabled)
-                    ReflectionTrace.MethodInfo_ReturnParameter(this);
-#endif
-
                 return this.RuntimeReturnParameter;
             }
         }
@@ -263,11 +229,6 @@ namespace System.Reflection.Runtime.MethodInfos
         {
             get
             {
-#if ENABLE_REFLECTION_TRACE
-                if (ReflectionTrace.Enabled)
-                    ReflectionTrace.MethodInfo_ReturnType(this);
-#endif
-
                 return ReturnParameter.ParameterType;
             }
         }
@@ -276,22 +237,6 @@ namespace System.Reflection.Runtime.MethodInfos
 
         public abstract override RuntimeMethodHandle MethodHandle { get; }
 
-        Type ITraceableTypeMember.ContainingType
-        {
-            get
-            {
-                return this.RuntimeDeclaringType;
-            }
-        }
-
-        string ITraceableTypeMember.MemberName
-        {
-            get
-            {
-                return this.RuntimeName;
-            }
-        }
-
         internal abstract RuntimeTypeInfo RuntimeDeclaringType
         {
             get;
@@ -527,7 +472,7 @@ namespace System.Reflection.Runtime.MethodInfos
             if (_debugName == null)
             {
                 _debugName = "Constructing..."; // Protect against any inadvertent reentrancy.
-                _debugName = ((ITraceableTypeMember)this).MemberName;
+                _debugName = RuntimeName;
             }
             return this;
         }
index 79c2810..252c556 100644 (file)
@@ -14,8 +14,6 @@ using System.Reflection.Runtime.CustomAttributes;
 
 using Internal.Reflection.Core.Execution;
 
-using Internal.Reflection.Tracing;
-
 namespace System.Reflection.Runtime.MethodInfos
 {
     internal abstract class RuntimeNamedMethodInfo : RuntimeMethodInfo
@@ -77,11 +75,6 @@ namespace System.Reflection.Runtime.MethodInfos
         {
             get
             {
-#if ENABLE_REFLECTION_TRACE
-                if (ReflectionTrace.Enabled)
-                    ReflectionTrace.MethodBase_CustomAttributes(this);
-#endif
-
                 foreach (CustomAttributeData cad in _common.TrueCustomAttributes)
                 {
                     yield return cad;
@@ -130,11 +123,6 @@ namespace System.Reflection.Runtime.MethodInfos
         [RequiresUnreferencedCode("If some of the generic arguments are annotated (either with DynamicallyAccessedMembersAttribute, or generic constraints), trimming can't validate that the requirements of those annotations are met.")]
         public sealed override MethodInfo MakeGenericMethod(params Type[] typeArguments)
         {
-#if ENABLE_REFLECTION_TRACE
-            if (ReflectionTrace.Enabled)
-                ReflectionTrace.MethodInfo_MakeGenericMethod(this, typeArguments);
-#endif
-
             if (typeArguments == null)
                 throw new ArgumentNullException(nameof(typeArguments));
             if (GenericTypeParameters.Length == 0)
@@ -157,7 +145,7 @@ namespace System.Reflection.Runtime.MethodInfos
             if (typeArguments.Length != GenericTypeParameters.Length)
                 throw new ArgumentException(SR.Format(SR.Argument_NotEnoughGenArguments, typeArguments.Length, GenericTypeParameters.Length));
             RuntimeMethodInfo methodInfo = (RuntimeMethodInfo)RuntimeConstructedGenericMethodInfo.GetRuntimeConstructedGenericMethodInfo(this, genericTypeArguments);
-            MethodInvoker methodInvoker = methodInfo.MethodInvoker; // For compatibility with other Make* apis, trigger any MissingMetadataExceptions now rather than later.
+            MethodInvoker _ = methodInfo.MethodInvoker; // For compatibility with other Make* apis, trigger any MissingMetadataExceptions now rather than later.
             return methodInfo;
         }
 
index 7e38250..030759f 100644 (file)
@@ -12,8 +12,6 @@ using System.Reflection.Runtime.ParameterInfos;
 
 using Internal.Reflection.Core.Execution;
 
-using Internal.Reflection.Tracing;
-
 namespace System.Reflection.Runtime.MethodInfos
 {
     //
@@ -65,11 +63,6 @@ namespace System.Reflection.Runtime.MethodInfos
         {
             get
             {
-#if ENABLE_REFLECTION_TRACE
-                if (ReflectionTrace.Enabled)
-                    ReflectionTrace.MethodBase_CustomAttributes(this);
-#endif
-
                 return _common.TrueCustomAttributes;
             }
         }
@@ -78,11 +71,6 @@ namespace System.Reflection.Runtime.MethodInfos
         {
             get
             {
-#if ENABLE_REFLECTION_TRACE
-                if (ReflectionTrace.Enabled)
-                    ReflectionTrace.MethodBase_DeclaringType(this);
-#endif
-
                 return _common.DeclaringType;
             }
         }
@@ -90,10 +78,6 @@ namespace System.Reflection.Runtime.MethodInfos
         [DebuggerGuidedStepThrough]
         public sealed override object Invoke(BindingFlags invokeAttr, Binder binder, object[] parameters, CultureInfo culture)
         {
-#if ENABLE_REFLECTION_TRACE
-            if (ReflectionTrace.Enabled)
-                ReflectionTrace.ConstructorInfo_Invoke(this, parameters);
-#endif
             if (parameters == null)
                 parameters = Array.Empty<object>();
 
@@ -127,11 +111,6 @@ namespace System.Reflection.Runtime.MethodInfos
         {
             get
             {
-#if ENABLE_REFLECTION_TRACE
-                if (ReflectionTrace.Enabled)
-                    ReflectionTrace.MethodBase_Name(this);
-#endif
-
                 return _common.Name;
             }
         }
index 44c5778..fc21a94 100644 (file)
@@ -20,8 +20,6 @@ using System.Reflection.Runtime.CustomAttributes;
 using Internal.Reflection.Core;
 using Internal.Reflection.Core.Execution;
 
-using Internal.Reflection.Tracing;
-
 using System.Reflection.Metadata;
 using System.Reflection.Metadata.Ecma335;
 
@@ -73,11 +71,6 @@ namespace System.Reflection.Runtime.PropertyInfos.EcmaFormat
         {
             get
             {
-#if ENABLE_REFLECTION_TRACE
-                if (ReflectionTrace.Enabled)
-                    ReflectionTrace.PropertyInfo_CustomAttributes(this);
-#endif
-
                 return RuntimeCustomAttributeData.GetCustomAttributes(_reader, _property.GetCustomAttributes());
             }
         }
index 775fd64..23d4527 100644 (file)
@@ -20,8 +20,6 @@ using System.Reflection.Runtime.CustomAttributes;
 using Internal.Reflection.Core;
 using Internal.Reflection.Core.Execution;
 
-using Internal.Reflection.Tracing;
-
 using Internal.Metadata.NativeFormat;
 using NativeFormatMethodSemanticsAttributes = global::Internal.Metadata.NativeFormat.MethodSemanticsAttributes;
 
@@ -73,11 +71,6 @@ namespace System.Reflection.Runtime.PropertyInfos.NativeFormat
         {
             get
             {
-#if ENABLE_REFLECTION_TRACE
-                if (ReflectionTrace.Enabled)
-                    ReflectionTrace.PropertyInfo_CustomAttributes(this);
-#endif
-
                 return RuntimeCustomAttributeData.GetCustomAttributes(_reader, _property.CustomAttributes);
             }
         }
index 20f4d25..32fb5ff 100644 (file)
@@ -17,16 +17,13 @@ using System.Reflection.Runtime.CustomAttributes;
 using Internal.Reflection.Core;
 using Internal.Reflection.Core.Execution;
 
-using Internal.Reflection.Tracing;
-
-
 namespace System.Reflection.Runtime.PropertyInfos
 {
     //
     // The runtime's implementation of PropertyInfo's
     //
     [DebuggerDisplay("{_debugName}")]
-    internal abstract partial class RuntimePropertyInfo : PropertyInfo, ITraceableTypeMember
+    internal abstract partial class RuntimePropertyInfo : PropertyInfo
     {
         //
         // propertyHandle - the "tkPropertyDef" that identifies the property.
@@ -73,11 +70,6 @@ namespace System.Reflection.Runtime.PropertyInfos
         {
             get
             {
-#if ENABLE_REFLECTION_TRACE
-                if (ReflectionTrace.Enabled)
-                    ReflectionTrace.PropertyInfo_DeclaringType(this);
-#endif
-
                 return ContextTypeInfo;
             }
         }
@@ -123,11 +115,6 @@ namespace System.Reflection.Runtime.PropertyInfos
         {
             get
             {
-#if ENABLE_REFLECTION_TRACE
-                if (ReflectionTrace.Enabled)
-                    ReflectionTrace.PropertyInfo_GetMethod(this);
-#endif
-
                 return Getter;
             }
         }
@@ -138,10 +125,6 @@ namespace System.Reflection.Runtime.PropertyInfos
 
         public sealed override object GetValue(object obj, BindingFlags invokeAttr, Binder binder, object[] index, CultureInfo culture)
         {
-#if ENABLE_REFLECTION_TRACE
-            if (ReflectionTrace.Enabled)
-                ReflectionTrace.PropertyInfo_GetValue(this, obj, index);
-#endif
             if (_lazyGetterInvoker == null)
             {
                 if (!CanRead)
@@ -168,11 +151,6 @@ namespace System.Reflection.Runtime.PropertyInfos
         {
             get
             {
-#if ENABLE_REFLECTION_TRACE
-                if (ReflectionTrace.Enabled)
-                    ReflectionTrace.PropertyInfo_Name(this);
-#endif
-
                 return MetadataName;
             }
         }
@@ -181,11 +159,6 @@ namespace System.Reflection.Runtime.PropertyInfos
         {
             get
             {
-#if ENABLE_REFLECTION_TRACE
-                if (ReflectionTrace.Enabled)
-                    ReflectionTrace.PropertyInfo_PropertyType(this);
-#endif
-
                 Type propertyType = _lazyPropertyType;
                 if (propertyType == null)
                 {
@@ -209,21 +182,12 @@ namespace System.Reflection.Runtime.PropertyInfos
         {
             get
             {
-#if ENABLE_REFLECTION_TRACE
-                if (ReflectionTrace.Enabled)
-                    ReflectionTrace.PropertyInfo_SetMethod(this);
-#endif
-
                 return Setter;
             }
         }
 
         public sealed override void SetValue(object obj, object value, BindingFlags invokeAttr, Binder binder, object[] index, CultureInfo culture)
         {
-#if ENABLE_REFLECTION_TRACE
-            if (ReflectionTrace.Enabled)
-                ReflectionTrace.PropertyInfo_SetValue(this, obj, value, index);
-#endif
             if (_lazySetterInvoker == null)
             {
                 if (!CanWrite)
@@ -270,22 +234,6 @@ namespace System.Reflection.Runtime.PropertyInfos
             return sb.ToString();
         }
 
-        string ITraceableTypeMember.MemberName
-        {
-            get
-            {
-                return MetadataName;
-            }
-        }
-
-        Type ITraceableTypeMember.ContainingType
-        {
-            get
-            {
-                return ContextTypeInfo;
-            }
-        }
-
         private RuntimeNamedMethodInfo Getter
         {
             get
@@ -386,11 +334,6 @@ namespace System.Reflection.Runtime.PropertyInfos
 
         private object GetConstantValue(bool raw)
         {
-#if ENABLE_REFLECTION_TRACE
-            if (ReflectionTrace.Enabled)
-                ReflectionTrace.PropertyInfo_GetConstantValue(this);
-#endif
-
             object defaultValue;
             if (!GetDefaultValueIfAny(raw, out defaultValue))
             {
diff --git a/src/coreclr/nativeaot/System.Private.Reflection.Core/src/System/Reflection/Runtime/Tracing/ReflectionEventSource.cs b/src/coreclr/nativeaot/System.Private.Reflection.Core/src/System/Reflection/Runtime/Tracing/ReflectionEventSource.cs
deleted file mode 100644 (file)
index 706a4fd..0000000
+++ /dev/null
@@ -1,376 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
-using System;
-using System.Diagnostics.Tracing;
-
-namespace System.Reflection.Runtime.Tracing
-{
-    [EventSource(Guid = "55B578AE-32B0-48F8-822F-B3245E6FA59C", Name = "System.Reflection.Runtime.Tracing")]
-    internal sealed class ReflectionEventSource : EventSource
-    {
-        // Defines the singleton instance for the Resources ETW provider
-        public static readonly ReflectionEventSource Log = new ReflectionEventSource();
-
-        public static bool IsInitialized
-        {
-            get
-            {
-                return Log != null;
-            }
-        }
-
-        private ReflectionEventSource() { }
-
-
-        #region Reflection Event Handlers
-        [Event(1)]
-        public void TypeInfo_CustomAttributes(string typeName)
-        {
-            WriteEvent(1, typeName);
-        }
-
-        [Event(2)]
-        public void TypeInfo_Name(string typeName)
-        {
-            WriteEvent(2, typeName);
-        }
-
-        [Event(3)]
-        public void TypeInfo_BaseType(string typeName)
-        {
-            WriteEvent(3, typeName);
-        }
-
-        [Event(4)]
-        public void TypeInfo_DeclaredConstructors(string typeName)
-        {
-            WriteEvent(4, typeName);
-        }
-
-        [Event(5)]
-        public void TypeInfo_DeclaredEvents(string typeName)
-        {
-            WriteEvent(5, typeName);
-        }
-
-        [Event(6)]
-        public void TypeInfo_DeclaredFields(string typeName)
-        {
-            WriteEvent(6, typeName);
-        }
-
-        [Event(7)]
-        public void TypeInfo_DeclaredMembers(string typeName)
-        {
-            WriteEvent(7, typeName);
-        }
-
-        [Event(8)]
-        public void TypeInfo_DeclaredMethods(string typeName)
-        {
-            WriteEvent(8, typeName);
-        }
-
-        [Event(9)]
-        public void TypeInfo_DeclaredNestedTypes(string typeName)
-        {
-            WriteEvent(9, typeName);
-        }
-
-        [Event(10)]
-        public void TypeInfo_DeclaredProperties(string typeName)
-        {
-            WriteEvent(10, typeName);
-        }
-
-        [Event(11)]
-        public void TypeInfo_DeclaringMethod(string typeName)
-        {
-            WriteEvent(11, typeName);
-        }
-
-        [Event(12)]
-        public void TypeInfo_FullName(string typeName)
-        {
-            WriteEvent(12, typeName);
-        }
-
-        [Event(13)]
-        public void TypeInfo_Namespace(string typeName)
-        {
-            WriteEvent(13, typeName);
-        }
-
-        [Event(14)]
-        public void TypeInfo_GetDeclaredEvent(string typeName, string eventName)
-        {
-            WriteEvent(14, typeName, eventName);
-        }
-
-        [Event(15)]
-        public void TypeInfo_GetDeclaredField(string typeName, string fieldName)
-        {
-            WriteEvent(15, typeName, fieldName);
-        }
-
-        [Event(16)]
-        public void TypeInfo_GetDeclaredMethod(string typeName, string methodName)
-        {
-            WriteEvent(16, typeName, methodName);
-        }
-
-        [Event(17)]
-        public void TypeInfo_GetDeclaredProperty(string typeName, string propertyName)
-        {
-            WriteEvent(17, typeName, propertyName);
-        }
-
-        [Event(18)]
-        public void TypeInfo_MakeArrayType(string typeName)
-        {
-            WriteEvent(18, typeName);
-        }
-
-        [Event(19)]
-        public void TypeInfo_MakeByRefType(string typeName)
-        {
-            WriteEvent(19, typeName);
-        }
-
-        [Event(20)]
-        public void TypeInfo_MakeGenericType(string typeName, string typeArguments)
-        {
-            WriteEvent(20, typeName, typeArguments);
-        }
-
-        [Event(21)]
-        public void TypeInfo_MakePointerType(string typeName)
-        {
-            WriteEvent(21, typeName);
-        }
-
-        [Event(22)]
-        public void Assembly_DefinedTypes(string assemblyName)
-        {
-            WriteEvent(22, assemblyName);
-        }
-
-        [Event(23)]
-        public void Assembly_GetType(string assemblyName, string typeName)
-        {
-            WriteEvent(23, assemblyName, typeName);
-        }
-
-        [Event(24)]
-        public void Assembly_CustomAttributes(string assemblyName)
-        {
-            WriteEvent(24, assemblyName);
-        }
-
-        [Event(25)]
-        public void Assembly_FullName(string assemblyName)
-        {
-            WriteEvent(25, assemblyName);
-        }
-
-        [Event(26)]
-        public void Assembly_GetName(string assemblyName)
-        {
-            WriteEvent(26, assemblyName);
-        }
-
-        [Event(27)]
-        public void CustomAttributeData_ConstructorArguments(string caName)
-        {
-            WriteEvent(27, caName);
-        }
-
-        [Event(28)]
-        public void CustomAttributeData_NamedArguments(string caName)
-        {
-            WriteEvent(28, caName);
-        }
-
-        [Event(29)]
-        public void EventInfo_AddMethod(string typeName, string eventName)
-        {
-            WriteEvent(29, typeName, eventName);
-        }
-
-        [Event(30)]
-        public void EventInfo_RaiseMethod(string typeName, string eventName)
-        {
-            WriteEvent(30, typeName, eventName);
-        }
-
-        [Event(31)]
-        public void EventInfo_RemoveMethod(string typeName, string eventName)
-        {
-            WriteEvent(31, typeName, eventName);
-        }
-
-        [Event(32)]
-        public void EventInfo_CustomAttributes(string typeName, string eventName)
-        {
-            WriteEvent(32, typeName, eventName);
-        }
-
-        [Event(33)]
-        public void EventInfo_Name(string typeName, string eventName)
-        {
-            WriteEvent(33, typeName, eventName);
-        }
-
-        [Event(34)]
-        public void EventInfo_DeclaringType(string typeName, string eventName)
-        {
-            WriteEvent(34, typeName, eventName);
-        }
-
-        [Event(35)]
-        public void FieldInfo_SetValue(string typeName, string fieldName)
-        {
-            WriteEvent(35, typeName, fieldName);
-        }
-
-        [Event(36)]
-        public void FieldInfo_GetValue(string typeName, string fieldName)
-        {
-            WriteEvent(36, typeName, fieldName);
-        }
-
-        [Event(37)]
-        public void FieldInfo_CustomAttributes(string typeName, string fieldName)
-        {
-            WriteEvent(37, typeName, fieldName);
-        }
-
-        [Event(38)]
-        public void FieldInfo_Name(string typeName, string fieldName)
-        {
-            WriteEvent(38, typeName, fieldName);
-        }
-
-        [Event(39)]
-        public void FieldInfo_DeclaringType(string typeName, string fieldName)
-        {
-            WriteEvent(39, typeName, fieldName);
-        }
-
-        [Event(40)]
-        public void MethodBase_CustomAttributes(string typeName, string methodName)
-        {
-            WriteEvent(40, typeName, methodName);
-        }
-
-        [Event(41)]
-        public void MethodBase_Name(string typeName, string methodName)
-        {
-            WriteEvent(41, typeName, methodName);
-        }
-
-        [Event(42)]
-        public void MethodBase_DeclaringType(string typeName, string methodName)
-        {
-            WriteEvent(42, typeName, methodName);
-        }
-
-        [Event(43)]
-        public void MethodBase_GetParameters(string typeName, string methodName)
-        {
-            WriteEvent(43, typeName, methodName);
-        }
-
-        [Event(44)]
-        public void MethodBase_Invoke(string typeName, string methodName)
-        {
-            WriteEvent(44, typeName, methodName);
-        }
-
-        [Event(45)]
-        public void MethodInfo_ReturnParameter(string typeName, string methodName)
-        {
-            WriteEvent(45, typeName, methodName);
-        }
-
-        [Event(46)]
-        public void MethodInfo_ReturnType(string typeName, string methodName)
-        {
-            WriteEvent(46, typeName, methodName);
-        }
-
-        [Event(47)]
-        public void MethodInfo_MakeGenericMethod(string typeName, string methodName, string typeArguments)
-        {
-            WriteEvent(47, typeName, methodName, typeArguments);
-        }
-
-        [Event(48)]
-        public void MethodInfo_CreateDelegate(string typeName, string methodName, string delegateTypeName)
-        {
-            WriteEvent(48, typeName, methodName, delegateTypeName);
-        }
-
-        [Event(49)]
-        public void PropertyInfo_GetValue(string typeName, string propertyName)
-        {
-            WriteEvent(49, typeName, propertyName);
-        }
-
-        [Event(50)]
-        public void PropertyInfo_SetValue(string typeName, string propertyName)
-        {
-            WriteEvent(50, typeName, propertyName);
-        }
-
-        [Event(51)]
-        public void PropertyInfo_GetMethod(string typeName, string propertyName)
-        {
-            WriteEvent(51, typeName, propertyName);
-        }
-
-        [Event(52)]
-        public void PropertyInfo_SetMethod(string typeName, string propertyName)
-        {
-            WriteEvent(52, typeName, propertyName);
-        }
-
-        [Event(53)]
-        public void PropertyInfo_GetConstantValue(string typeName, string propertyName)
-        {
-            WriteEvent(53, typeName, propertyName);
-        }
-
-        [Event(54)]
-        public void PropertyInfo_PropertyType(string typeName, string propertyName)
-        {
-            WriteEvent(54, typeName, propertyName);
-        }
-
-        [Event(55)]
-        public void PropertyInfo_CustomAttributes(string typeName, string propertyName)
-        {
-            WriteEvent(55, typeName, propertyName);
-        }
-
-        [Event(56)]
-        public void PropertyInfo_Name(string typeName, string propertyName)
-        {
-            WriteEvent(56, typeName, propertyName);
-        }
-
-        [Event(57)]
-        public void PropertyInfo_DeclaringType(string typeName, string propertyName)
-        {
-            WriteEvent(57, typeName, propertyName);
-        }
-
-        [Event(58)]
-        public void TypeInfo_AssemblyQualifiedName(string typeName)
-        {
-            WriteEvent(58, typeName);
-        }
-        #endregion
-    }
-}
index 11fdded..4144e4a 100644 (file)
@@ -11,8 +11,6 @@ using System.Reflection.Runtime.MethodInfos;
 using System.Reflection.Runtime.TypeInfos;
 using System.Reflection.Runtime.CustomAttributes;
 
-using Internal.Reflection.Tracing;
-
 using Internal.Metadata.NativeFormat;
 
 namespace System.Reflection.Runtime.TypeInfos.NativeFormat
@@ -31,11 +29,6 @@ namespace System.Reflection.Runtime.TypeInfos.NativeFormat
         {
             get
             {
-#if ENABLE_REFLECTION_TRACE
-                if (ReflectionTrace.Enabled)
-                    ReflectionTrace.TypeInfo_CustomAttributes(this);
-#endif
-
                 return RuntimeCustomAttributeData.GetCustomAttributes(Reader, _genericParameter.CustomAttributes);
             }
         }
index c77d716..b9de30f 100644 (file)
@@ -10,9 +10,6 @@ using System.Reflection.Runtime.General;
 using System.Reflection.Runtime.MethodInfos;
 using System.Reflection.Runtime.TypeInfos;
 
-
-using Internal.Reflection.Tracing;
-
 using Internal.Metadata.NativeFormat;
 
 namespace System.Reflection.Runtime.TypeInfos.NativeFormat
@@ -33,10 +30,6 @@ namespace System.Reflection.Runtime.TypeInfos.NativeFormat
         {
             get
             {
-#if ENABLE_REFLECTION_TRACE
-                if (ReflectionTrace.Enabled)
-                    ReflectionTrace.TypeInfo_DeclaringMethod(this);
-#endif
                 return _declaringRuntimeNamedMethodInfo;
             }
         }
index 90a0847..8f5658c 100644 (file)
@@ -8,8 +8,6 @@ using System.Collections.Generic;
 using System.Reflection.Runtime.General;
 using System.Reflection.Runtime.TypeInfos;
 
-using Internal.Reflection.Tracing;
-
 using Internal.Metadata.NativeFormat;
 
 namespace System.Reflection.Runtime.TypeInfos.NativeFormat
@@ -29,10 +27,6 @@ namespace System.Reflection.Runtime.TypeInfos.NativeFormat
         {
             get
             {
-#if ENABLE_REFLECTION_TRACE
-                if (ReflectionTrace.Enabled)
-                    ReflectionTrace.TypeInfo_DeclaringMethod(this);
-#endif
                 return null;
             }
         }
index a1d0567..80b394d 100644 (file)
@@ -9,8 +9,6 @@ using System.Reflection.Runtime.Assemblies;
 using System.Reflection.Runtime.General;
 using System.Reflection.Runtime.CustomAttributes;
 
-using Internal.Reflection.Tracing;
-
 using Internal.Metadata.NativeFormat;
 
 namespace System.Reflection.Runtime.TypeInfos.NativeFormat
@@ -87,11 +85,6 @@ namespace System.Reflection.Runtime.TypeInfos.NativeFormat
         {
             get
             {
-#if ENABLE_REFLECTION_TRACE
-                if (ReflectionTrace.Enabled)
-                    ReflectionTrace.TypeInfo_Namespace(this);
-#endif
-
                 return NamespaceChain.NameSpace.EscapeTypeNameIdentifier();
             }
         }
@@ -285,35 +278,6 @@ namespace System.Reflection.Runtime.TypeInfos.NativeFormat
             return base.Equals(otherAsObject);
         }
 
-#if ENABLE_REFLECTION_TRACE
-        internal sealed override string TraceableTypeName
-        {
-            get
-            {
-                MetadataReader reader = Reader;
-
-                String s = "";
-                TypeDefinitionHandle typeDefinitionHandle = TypeDefinitionHandle;
-                do
-                {
-                    TypeDefinition typeDefinition = typeDefinitionHandle.GetTypeDefinition(reader);
-                    String name = typeDefinition.Name.GetString(reader);
-                    if (s == "")
-                        s = name;
-                    else
-                        s = name + "+" + s;
-                    typeDefinitionHandle = typeDefinition.EnclosingType;
-                }
-                while (!typeDefinitionHandle.IsNull(reader));
-
-                String ns = NamespaceChain.NameSpace;
-                if (ns != null)
-                    s = ns + "." + s;
-                return s;
-            }
-        }
-#endif
-
         internal sealed override QTypeDefRefOrSpec TypeDefinitionQHandle
         {
             get
index e625166..b5ccec1 100644 (file)
@@ -11,7 +11,6 @@ using System.Reflection.Runtime.Assemblies;
 using System.Reflection.Runtime.CustomAttributes;
 
 using Internal.LowLevelLinq;
-using Internal.Reflection.Tracing;
 using Internal.Reflection.Core.Execution;
 
 using CharSet = System.Runtime.InteropServices.CharSet;
@@ -57,10 +56,6 @@ namespace System.Reflection.Runtime.TypeInfos
         {
             get
             {
-#if ENABLE_REFLECTION_TRACE
-                if (ReflectionTrace.Enabled)
-                    ReflectionTrace.TypeInfo_CustomAttributes(this);
-#endif
                 return Empty<CustomAttributeData>.Enumerable;
             }
         }
@@ -69,10 +64,6 @@ namespace System.Reflection.Runtime.TypeInfos
         {
             get
             {
-#if ENABLE_REFLECTION_TRACE
-                if (ReflectionTrace.Enabled)
-                    ReflectionTrace.TypeInfo_FullName(this);
-#endif
                 return GeneratedName;
             }
         }
@@ -101,10 +92,6 @@ namespace System.Reflection.Runtime.TypeInfos
         {
             get
             {
-#if ENABLE_REFLECTION_TRACE
-                if (ReflectionTrace.Enabled)
-                    ReflectionTrace.TypeInfo_Namespace(this);
-#endif
                 return null;  // Reflection-blocked framework types report themselves as existing in the "root" namespace.
             }
         }
index ec4b500..0e6fda3 100644 (file)
@@ -8,7 +8,6 @@ using System.Reflection.Runtime.General;
 using System.Reflection.Runtime.MethodInfos;
 using System.Runtime.InteropServices;
 
-using Internal.Reflection.Tracing;
 using Internal.Reflection.Core.Execution;
 
 namespace System.Reflection.Runtime.TypeInfos
@@ -40,11 +39,6 @@ namespace System.Reflection.Runtime.TypeInfos
         {
             get
             {
-#if ENABLE_REFLECTION_TRACE
-                if (ReflectionTrace.Enabled)
-                    ReflectionTrace.TypeInfo_CustomAttributes(this);
-#endif
-
                 return Empty<CustomAttributeData>.Enumerable;
             }
         }
index 6393840..5cd6c23 100644 (file)
@@ -10,7 +10,6 @@ using System.Collections.Concurrent;
 using System.Reflection.Runtime.General;
 using System.Reflection.Runtime.TypeInfos;
 
-using Internal.Reflection.Tracing;
 using Internal.Reflection.Core.Execution;
 
 using StructLayoutAttribute = System.Runtime.InteropServices.StructLayoutAttribute;
@@ -75,11 +74,6 @@ namespace System.Reflection.Runtime.TypeInfos
         {
             get
             {
-#if ENABLE_REFLECTION_TRACE
-                if (ReflectionTrace.Enabled)
-                    ReflectionTrace.TypeInfo_CustomAttributes(this);
-#endif
-
                 return GenericTypeDefinitionTypeInfo.CustomAttributes;
             }
         }
@@ -88,10 +82,6 @@ namespace System.Reflection.Runtime.TypeInfos
         {
             get
             {
-#if ENABLE_REFLECTION_TRACE
-                if (ReflectionTrace.Enabled)
-                    ReflectionTrace.TypeInfo_FullName(this);
-#endif
                 // Desktop quirk: open constructions don't have "fullNames".
                 if (ContainsGenericParameters)
                     return null;
@@ -158,10 +148,6 @@ namespace System.Reflection.Runtime.TypeInfos
         {
             get
             {
-#if ENABLE_REFLECTION_TRACE
-                if (ReflectionTrace.Enabled)
-                    ReflectionTrace.TypeInfo_Namespace(this);
-#endif
                 return GenericTypeDefinitionTypeInfo.Namespace;
             }
         }
index 2434f3b..28f1962 100644 (file)
@@ -13,8 +13,6 @@ using System.Reflection.Runtime.CustomAttributes;
 using Internal.Reflection.Core;
 using Internal.Reflection.Core.Execution;
 
-using Internal.Reflection.Tracing;
-
 namespace System.Reflection.Runtime.TypeInfos
 {
     internal abstract class RuntimeGenericParameterTypeInfo : RuntimeTypeInfo
@@ -67,10 +65,6 @@ namespace System.Reflection.Runtime.TypeInfos
         {
             get
             {
-#if ENABLE_REFLECTION_TRACE
-                if (ReflectionTrace.Enabled)
-                    ReflectionTrace.TypeInfo_FullName(this);
-#endif
                 return null;  // We return null as generic parameter types are not roundtrippable through Type.GetType().
             }
         }
@@ -100,10 +94,6 @@ namespace System.Reflection.Runtime.TypeInfos
         {
             get
             {
-#if ENABLE_REFLECTION_TRACE
-                if (ReflectionTrace.Enabled)
-                    ReflectionTrace.TypeInfo_Namespace(this);
-#endif
                 return DeclaringType.Namespace;
             }
         }
index f0dbbac..05a65a8 100644 (file)
@@ -10,8 +10,6 @@ using System.Runtime.InteropServices;
 using System.Reflection.Runtime.General;
 using System.Reflection.Runtime.TypeInfos;
 
-using Internal.Reflection.Tracing;
-
 namespace System.Reflection.Runtime.TypeInfos
 {
     //
@@ -79,11 +77,6 @@ namespace System.Reflection.Runtime.TypeInfos
         {
             get
             {
-#if ENABLE_REFLECTION_TRACE
-                if (ReflectionTrace.Enabled)
-                    ReflectionTrace.TypeInfo_CustomAttributes(this);
-#endif
-
                 return Empty<CustomAttributeData>.Enumerable;
             }
         }
@@ -100,10 +93,6 @@ namespace System.Reflection.Runtime.TypeInfos
         {
             get
             {
-#if ENABLE_REFLECTION_TRACE
-                if (ReflectionTrace.Enabled)
-                    ReflectionTrace.TypeInfo_FullName(this);
-#endif
                 string elementFullName = _key.ElementType.FullName;
                 if (elementFullName == null)
                     return null;
@@ -124,10 +113,6 @@ namespace System.Reflection.Runtime.TypeInfos
         {
             get
             {
-#if ENABLE_REFLECTION_TRACE
-                if (ReflectionTrace.Enabled)
-                    ReflectionTrace.TypeInfo_Namespace(this);
-#endif
                 return _key.ElementType.Namespace;
             }
         }
index 3622630..ddf9982 100644 (file)
@@ -8,8 +8,6 @@ using System.Runtime.InteropServices;
 using System.Reflection.Runtime.General;
 using System.Reflection.Runtime.CustomAttributes;
 
-using Internal.Reflection.Tracing;
-
 #pragma warning disable CA1067 // override Equals because it implements IEquatable<T>
 
 namespace System.Reflection.Runtime.TypeInfos
@@ -37,11 +35,6 @@ namespace System.Reflection.Runtime.TypeInfos
         {
             get
             {
-#if ENABLE_REFLECTION_TRACE
-                if (ReflectionTrace.Enabled)
-                    ReflectionTrace.TypeInfo_CustomAttributes(this);
-#endif
-
                 foreach (CustomAttributeData cad in TrueCustomAttributes)
                     yield return cad;
 
@@ -94,11 +87,6 @@ namespace System.Reflection.Runtime.TypeInfos
         {
             get
             {
-#if ENABLE_REFLECTION_TRACE
-                if (ReflectionTrace.Enabled)
-                    ReflectionTrace.TypeInfo_FullName(this);
-#endif
-
                 Debug.Assert(!IsConstructedGenericType);
                 Debug.Assert(!IsGenericParameter);
                 Debug.Assert(!HasElementType);
@@ -210,10 +198,6 @@ namespace System.Reflection.Runtime.TypeInfos
             }
         }
 
-#if ENABLE_REFLECTION_TRACE
-        internal abstract string TraceableTypeName { get; }
-#endif
-
         /// <summary>
         /// QTypeDefRefOrSpec handle that can be used to re-acquire this type. Must be implemented
         /// for all metadata sourced type implementations.
index cc95bb1..2939a88 100644 (file)
@@ -11,7 +11,6 @@ using System.Reflection.Runtime.Assemblies;
 using System.Reflection.Runtime.CustomAttributes;
 
 using Internal.LowLevelLinq;
-using Internal.Reflection.Tracing;
 using Internal.Reflection.Core.Execution;
 
 using StructLayoutAttribute = System.Runtime.InteropServices.StructLayoutAttribute;
@@ -58,10 +57,6 @@ namespace System.Reflection.Runtime.TypeInfos
         {
             get
             {
-#if ENABLE_REFLECTION_TRACE
-                if (ReflectionTrace.Enabled)
-                    ReflectionTrace.TypeInfo_FullName(this);
-#endif
                 throw ReflectionCoreExecution.ExecutionDomain.CreateMissingMetadataException(this);
             }
         }
@@ -90,10 +85,6 @@ namespace System.Reflection.Runtime.TypeInfos
         {
             get
             {
-#if ENABLE_REFLECTION_TRACE
-                if (ReflectionTrace.Enabled)
-                    ReflectionTrace.TypeInfo_Namespace(this);
-#endif
                 throw ReflectionCoreExecution.ExecutionDomain.CreateMissingMetadataException(this);
             }
         }
index bf946e9..647b50e 100644 (file)
@@ -11,7 +11,6 @@ using System.Reflection.Runtime.MethodInfos;
 
 using Internal.Reflection.Core.Execution;
 using Internal.Reflection.Core.NonPortable;
-using Internal.Reflection.Tracing;
 using Internal.Reflection.Augments;
 
 using StructLayoutAttribute = System.Runtime.InteropServices.StructLayoutAttribute;
@@ -34,7 +33,7 @@ namespace System.Reflection.Runtime.TypeInfos
     //     shows up as build error.
     //
     [DebuggerDisplay("{_debugName}")]
-    internal abstract partial class RuntimeTypeInfo : RuntimeType, ITraceableTypeMember, ICloneable
+    internal abstract partial class RuntimeTypeInfo : RuntimeType, ICloneable
     {
         protected RuntimeTypeInfo()
         {
@@ -61,11 +60,6 @@ namespace System.Reflection.Runtime.TypeInfos
         {
             get
             {
-#if ENABLE_REFLECTION_TRACE
-                if (ReflectionTrace.Enabled)
-                    ReflectionTrace.TypeInfo_AssemblyQualifiedName(this);
-#endif
-
                 string fullName = FullName;
                 if (fullName == null)   // Some Types (such as generic parameters) return null for FullName by design.
                     return null;
@@ -83,11 +77,6 @@ namespace System.Reflection.Runtime.TypeInfos
         {
             get
             {
-#if ENABLE_REFLECTION_TRACE
-                if (ReflectionTrace.Enabled)
-                    ReflectionTrace.TypeInfo_BaseType(this);
-#endif
-
                 // If this has a RuntimeTypeHandle, let the underlying runtime engine have the first crack. If it refuses, fall back to metadata.
                 RuntimeTypeHandle typeHandle = InternalTypeHandleIfAvailable;
                 if (!typeHandle.IsNull())
@@ -427,11 +416,6 @@ namespace System.Reflection.Runtime.TypeInfos
         [RequiresDynamicCode("The code for an array of the specified type might not be available.")]
         public sealed override Type MakeArrayType()
         {
-#if ENABLE_REFLECTION_TRACE
-            if (ReflectionTrace.Enabled)
-                ReflectionTrace.TypeInfo_MakeArrayType(this);
-#endif
-
             // Do not implement this as a call to MakeArrayType(1) - they are not interchangable. MakeArrayType() returns a
             // vector type ("SZArray") while MakeArrayType(1) returns a multidim array of rank 1. These are distinct types
             // in the ECMA model and in CLR Reflection.
@@ -441,11 +425,6 @@ namespace System.Reflection.Runtime.TypeInfos
         [RequiresDynamicCode("The code for an array of the specified type might not be available.")]
         public sealed override Type MakeArrayType(int rank)
         {
-#if ENABLE_REFLECTION_TRACE
-            if (ReflectionTrace.Enabled)
-                ReflectionTrace.TypeInfo_MakeArrayType(this, rank);
-#endif
-
             if (rank <= 0)
                 throw new IndexOutOfRangeException();
             return this.GetMultiDimArrayTypeWithTypeHandle(rank);
@@ -453,10 +432,6 @@ namespace System.Reflection.Runtime.TypeInfos
 
         public sealed override Type MakeByRefType()
         {
-#if ENABLE_REFLECTION_TRACE
-            if (ReflectionTrace.Enabled)
-                ReflectionTrace.TypeInfo_MakeByRefType(this);
-#endif
             return this.GetByRefType();
         }
 
@@ -464,11 +439,6 @@ namespace System.Reflection.Runtime.TypeInfos
         [RequiresUnreferencedCode("If some of the generic arguments are annotated (either with DynamicallyAccessedMembersAttribute, or generic constraints), trimming can't validate that the requirements of those annotations are met.")]
         public sealed override Type MakeGenericType(params Type[] typeArguments)
         {
-#if ENABLE_REFLECTION_TRACE
-            if (ReflectionTrace.Enabled)
-                ReflectionTrace.TypeInfo_MakeGenericType(this, typeArguments);
-#endif
-
             if (typeArguments == null)
                 throw new ArgumentNullException(nameof(typeArguments));
 
@@ -520,11 +490,6 @@ namespace System.Reflection.Runtime.TypeInfos
 
         public sealed override Type MakePointerType()
         {
-#if ENABLE_REFLECTION_TRACE
-            if (ReflectionTrace.Enabled)
-                ReflectionTrace.TypeInfo_MakePointerType(this);
-#endif
-
             return this.GetPointerType();
         }
 
@@ -540,11 +505,6 @@ namespace System.Reflection.Runtime.TypeInfos
         {
             get
             {
-#if ENABLE_REFLECTION_TRACE
-                if (ReflectionTrace.Enabled)
-                    ReflectionTrace.TypeInfo_Name(this);
-#endif
-
                 Type rootCauseForFailure = null;
                 string name = InternalGetNameIfAvailable(ref rootCauseForFailure);
                 if (name == null)
@@ -623,23 +583,6 @@ namespace System.Reflection.Runtime.TypeInfos
             return 0 != (Classification & TypeClassification.IsValueType);
         }
 
-        string ITraceableTypeMember.MemberName
-        {
-            get
-            {
-                string name = InternalNameIfAvailable;
-                return name ?? string.Empty;
-            }
-        }
-
-        Type ITraceableTypeMember.ContainingType
-        {
-            get
-            {
-                return this.InternalDeclaringType;
-            }
-        }
-
         //
         // Returns the anchoring typedef that declares the members that this type wants returned by the Declared*** properties.
         // The Declared*** properties will project the anchoring typedef's members by overriding their DeclaringType property with "this"
@@ -799,11 +742,6 @@ namespace System.Reflection.Runtime.TypeInfos
             {
                 _debugName = "Constructing..."; // Protect against any inadvertent reentrancy.
                 string debugName;
-#if ENABLE_REFLECTION_TRACE
-                if (ReflectionTrace.Enabled)
-                    debugName = this.GetTraceString();  // If tracing on, call this.GetTraceString() which only gives you useful strings when metadata is available but doesn't pollute the ETW trace.
-                else
-#endif
                 debugName = this.ToString();
                 if (debugName == null)
                     debugName = "";