Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
106 changes: 93 additions & 13 deletions tracer/src/Datadog.Trace.Trimming/build/Datadog.Trace.Trimming.xml
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@
<type fullname="System.Collections.Immutable.ImmutableHashSet`1" />
<type fullname="System.Collections.Immutable.ImmutableHashSet`1/Builder" />
<type fullname="System.Collections.Immutable.ImmutableHashSet`1/Enumerator" />
<type fullname="System.Linq.ImmutableArrayExtensions" />
</assembly>
<assembly fullname="System.Collections.NonGeneric">
<type fullname="System.Collections.Queue" />
Expand Down Expand Up @@ -320,7 +319,6 @@
<type fullname="System.IO.IsolatedStorage.IsolatedStorageScope" />
</assembly>
<assembly fullname="System.IO.MemoryMappedFiles">
<type fullname="Microsoft.Win32.SafeHandles.SafeMemoryMappedViewHandle" />
<type fullname="System.IO.MemoryMappedFiles.MemoryMappedFile" />
<type fullname="System.IO.MemoryMappedFiles.MemoryMappedFileAccess" />
<type fullname="System.IO.MemoryMappedFiles.MemoryMappedViewAccessor" />
Expand Down Expand Up @@ -500,12 +498,104 @@
<assembly fullname="System.Reflection.Emit.Lightweight">
<type fullname="System.Reflection.Emit.DynamicMethod" />
</assembly>
<assembly fullname="System.Reflection.Metadata">
<type fullname="System.Reflection.Metadata.ArrayShape" />
<type fullname="System.Reflection.Metadata.AssemblyDefinition" />
<type fullname="System.Reflection.Metadata.AssemblyReference" />
<type fullname="System.Reflection.Metadata.AssemblyReferenceHandle" />
<type fullname="System.Reflection.Metadata.BlobHandle" />
<type fullname="System.Reflection.Metadata.BlobReader" />
<type fullname="System.Reflection.Metadata.CustomAttribute" />
<type fullname="System.Reflection.Metadata.CustomAttributeHandle" />
<type fullname="System.Reflection.Metadata.CustomAttributeHandleCollection" />
<type fullname="System.Reflection.Metadata.CustomAttributeHandleCollection/Enumerator" />
<type fullname="System.Reflection.Metadata.CustomAttributeTypedArgument`1" />
<type fullname="System.Reflection.Metadata.CustomAttributeValue`1" />
<type fullname="System.Reflection.Metadata.CustomDebugInformation" />
<type fullname="System.Reflection.Metadata.CustomDebugInformationHandle" />
<type fullname="System.Reflection.Metadata.CustomDebugInformationHandleCollection" />
<type fullname="System.Reflection.Metadata.CustomDebugInformationHandleCollection/Enumerator" />
<type fullname="System.Reflection.Metadata.Document" />
<type fullname="System.Reflection.Metadata.DocumentHandle" />
<type fullname="System.Reflection.Metadata.DocumentHandleCollection" />
<type fullname="System.Reflection.Metadata.DocumentHandleCollection/Enumerator" />
<type fullname="System.Reflection.Metadata.DocumentNameBlobHandle" />
<type fullname="System.Reflection.Metadata.Ecma335.MetadataTokens" />
<type fullname="System.Reflection.Metadata.Ecma335.SignatureDecoder`2" />
<type fullname="System.Reflection.Metadata.EntityHandle" />
<type fullname="System.Reflection.Metadata.FieldDefinition" />
<type fullname="System.Reflection.Metadata.FieldDefinitionHandle" />
<type fullname="System.Reflection.Metadata.FieldDefinitionHandleCollection" />
<type fullname="System.Reflection.Metadata.FieldDefinitionHandleCollection/Enumerator" />
<type fullname="System.Reflection.Metadata.GuidHandle" />
<type fullname="System.Reflection.Metadata.Handle" />
<type fullname="System.Reflection.Metadata.HandleKind" />
<type fullname="System.Reflection.Metadata.IConstructedTypeProvider`1" />
<type fullname="System.Reflection.Metadata.ICustomAttributeTypeProvider`1" />
<type fullname="System.Reflection.Metadata.InterfaceImplementation" />
<type fullname="System.Reflection.Metadata.InterfaceImplementationHandle" />
<type fullname="System.Reflection.Metadata.InterfaceImplementationHandleCollection" />
<type fullname="System.Reflection.Metadata.InterfaceImplementationHandleCollection/Enumerator" />
<type fullname="System.Reflection.Metadata.ISignatureTypeProvider`2" />
<type fullname="System.Reflection.Metadata.ISimpleTypeProvider`1" />
<type fullname="System.Reflection.Metadata.ISZArrayTypeProvider`1" />
<type fullname="System.Reflection.Metadata.LocalConstant" />
<type fullname="System.Reflection.Metadata.LocalConstantHandle" />
<type fullname="System.Reflection.Metadata.LocalConstantHandleCollection" />
<type fullname="System.Reflection.Metadata.LocalConstantHandleCollection/Enumerator" />
<type fullname="System.Reflection.Metadata.LocalScope" />
<type fullname="System.Reflection.Metadata.LocalScopeHandle" />
<type fullname="System.Reflection.Metadata.LocalScopeHandleCollection" />
<type fullname="System.Reflection.Metadata.LocalScopeHandleCollection/Enumerator" />
<type fullname="System.Reflection.Metadata.LocalVariable" />
<type fullname="System.Reflection.Metadata.LocalVariableAttributes" />
<type fullname="System.Reflection.Metadata.LocalVariableHandle" />
<type fullname="System.Reflection.Metadata.LocalVariableHandleCollection" />
<type fullname="System.Reflection.Metadata.LocalVariableHandleCollection/Enumerator" />
<type fullname="System.Reflection.Metadata.MemberReference" />
<type fullname="System.Reflection.Metadata.MemberReferenceHandle" />
<type fullname="System.Reflection.Metadata.MetadataReader" />
<type fullname="System.Reflection.Metadata.MetadataReaderOptions" />
<type fullname="System.Reflection.Metadata.MetadataReaderProvider" />
<type fullname="System.Reflection.Metadata.MetadataStringDecoder" />
<type fullname="System.Reflection.Metadata.MethodBodyBlock" />
<type fullname="System.Reflection.Metadata.MethodDebugInformation" />
<type fullname="System.Reflection.Metadata.MethodDebugInformationHandle" />
<type fullname="System.Reflection.Metadata.MethodDefinition" />
<type fullname="System.Reflection.Metadata.MethodDefinitionHandle" />
<type fullname="System.Reflection.Metadata.MethodDefinitionHandleCollection" />
<type fullname="System.Reflection.Metadata.MethodDefinitionHandleCollection/Enumerator" />
<type fullname="System.Reflection.Metadata.MethodSignature`1" />
<type fullname="System.Reflection.Metadata.ModuleReference" />
<type fullname="System.Reflection.Metadata.ModuleReferenceHandle" />
<type fullname="System.Reflection.Metadata.Parameter" />
<type fullname="System.Reflection.Metadata.ParameterHandle" />
<type fullname="System.Reflection.Metadata.ParameterHandleCollection" />
<type fullname="System.Reflection.Metadata.ParameterHandleCollection/Enumerator" />
<type fullname="System.Reflection.Metadata.PEReaderExtensions" />
<type fullname="System.Reflection.Metadata.PrimitiveTypeCode" />
<type fullname="System.Reflection.Metadata.SequencePoint" />
<type fullname="System.Reflection.Metadata.SequencePointCollection" />
<type fullname="System.Reflection.Metadata.SequencePointCollection/Enumerator" />
<type fullname="System.Reflection.Metadata.StandaloneSignature" />
<type fullname="System.Reflection.Metadata.StandaloneSignatureHandle" />
<type fullname="System.Reflection.Metadata.StringHandle" />
<type fullname="System.Reflection.Metadata.TypeDefinition" />
<type fullname="System.Reflection.Metadata.TypeDefinitionHandle" />
<type fullname="System.Reflection.Metadata.TypeDefinitionHandleCollection" />
<type fullname="System.Reflection.Metadata.TypeDefinitionHandleCollection/Enumerator" />
<type fullname="System.Reflection.Metadata.TypeReference" />
<type fullname="System.Reflection.Metadata.TypeReferenceHandle" />
<type fullname="System.Reflection.Metadata.TypeSpecification" />
<type fullname="System.Reflection.Metadata.TypeSpecificationHandle" />
<type fullname="System.Reflection.PortableExecutable.PEReader" />
<type fullname="System.Reflection.PortableExecutable.PEStreamOptions" />
</assembly>
<assembly fullname="System.Reflection.Primitives">
<type fullname="System.Reflection.Emit.OpCode" />
<type fullname="System.Reflection.Emit.OpCodes" />
</assembly>
<assembly fullname="System.Resources.ResourceManager">
<type fullname="System.Resources.MissingManifestResourceException" />
<type fullname="System.Resources.NeutralResourcesLanguageAttribute" />
<type fullname="System.Resources.ResourceManager" />
</assembly>
Expand Down Expand Up @@ -690,7 +780,6 @@
<type fullname="System.IO.StringWriter" />
<type fullname="System.IO.TextReader" />
<type fullname="System.IO.TextWriter" />
<type fullname="System.IO.UnmanagedMemoryStream" />
<type fullname="System.IObservable`1" />
<type fullname="System.IObserver`1" />
<type fullname="System.ISpanFormattable" />
Expand All @@ -715,7 +804,6 @@
<type fullname="System.OperatingSystem" />
<type fullname="System.OperationCanceledException" />
<type fullname="System.OutOfMemoryException" />
<type fullname="System.OverflowException" />
<type fullname="System.ParamArrayAttribute" />
<type fullname="System.PlatformID" />
<type fullname="System.PlatformNotSupportedException" />
Expand All @@ -728,7 +816,6 @@
<type fullname="System.Reflection.Assembly" />
<type fullname="System.Reflection.AssemblyCompanyAttribute" />
<type fullname="System.Reflection.AssemblyConfigurationAttribute" />
<type fullname="System.Reflection.AssemblyContentType" />
<type fullname="System.Reflection.AssemblyCopyrightAttribute" />
<type fullname="System.Reflection.AssemblyDescriptionAttribute" />
<type fullname="System.Reflection.AssemblyFileVersionAttribute" />
Expand All @@ -747,11 +834,9 @@
<type fullname="System.Reflection.CustomAttributeNamedArgument" />
<type fullname="System.Reflection.CustomAttributeTypedArgument" />
<type fullname="System.Reflection.DefaultMemberAttribute" />
<type fullname="System.Reflection.EventAttributes" />
<type fullname="System.Reflection.EventInfo" />
<type fullname="System.Reflection.FieldAttributes" />
<type fullname="System.Reflection.FieldInfo" />
<type fullname="System.Reflection.GenericParameterAttributes" />
<type fullname="System.Reflection.ICustomAttributeProvider" />
<type fullname="System.Reflection.IntrospectionExtensions" />
<type fullname="System.Reflection.LocalVariableInfo" />
Expand All @@ -774,7 +859,6 @@
<type fullname="System.Reflection.TypeAttributes" />
<type fullname="System.Reflection.TypeInfo" />
<type fullname="System.ResolveEventArgs" />
<type fullname="System.Resources.MissingManifestResourceException" />
<type fullname="System.Resources.NeutralResourcesLanguageAttribute" />
<type fullname="System.Resources.ResourceManager" />
<type fullname="System.Runtime.CompilerServices.AsyncIteratorStateMachineAttribute" />
Expand Down Expand Up @@ -826,15 +910,13 @@
<type fullname="System.Runtime.CompilerServices.UnsafeValueTypeAttribute" />
<type fullname="System.Runtime.CompilerServices.YieldAwaitable" />
<type fullname="System.Runtime.CompilerServices.YieldAwaitable/YieldAwaiter" />
<type fullname="System.Runtime.ConstrainedExecution.CriticalFinalizerObject" />
<type fullname="System.Runtime.ExceptionServices.ExceptionDispatchInfo" />
<type fullname="System.Runtime.ExceptionServices.FirstChanceExceptionEventArgs" />
<type fullname="System.Runtime.ExceptionServices.HandleProcessCorruptedStateExceptionsAttribute" />
<type fullname="System.Runtime.InteropServices.ComVisibleAttribute" />
<type fullname="System.Runtime.InteropServices.GCHandle" />
<type fullname="System.Runtime.InteropServices.GCHandleType" />
<type fullname="System.Runtime.InteropServices.InAttribute" />
<type fullname="System.Runtime.InteropServices.SafeBuffer" />
<type fullname="System.Runtime.InteropServices.SafeHandle" />
<type fullname="System.Runtime.Serialization.IFormatterConverter" />
<type fullname="System.Runtime.Serialization.ISerializable" />
Expand Down Expand Up @@ -972,7 +1054,6 @@
<assembly fullname="System.Runtime.InteropServices">
<type fullname="System.DllNotFoundException" />
<type fullname="System.IO.UnmanagedMemoryAccessor" />
<type fullname="System.IO.UnmanagedMemoryStream" />
<type fullname="System.Runtime.InteropServices.CallingConvention" />
<type fullname="System.Runtime.InteropServices.CollectionsMarshal" />
<type fullname="System.Runtime.InteropServices.COMException" />
Expand All @@ -987,7 +1068,6 @@
<type fullname="System.Runtime.InteropServices.PosixSignal" />
<type fullname="System.Runtime.InteropServices.PosixSignalContext" />
<type fullname="System.Runtime.InteropServices.PosixSignalRegistration" />
<type fullname="System.Runtime.InteropServices.SafeBuffer" />
<type fullname="System.Runtime.InteropServices.UnmanagedFunctionPointerAttribute" />
<type fullname="System.Security.SecureString" />
</assembly>
Expand Down
3 changes: 1 addition & 2 deletions tracer/src/Datadog.Trace/Datadog.Trace.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,8 @@
</ItemGroup>

<!-- we don't need the vendored .NET runtime code when targetting .NET Core 3.1+ -->
<!-- but keep Vendors/System.Reflection.Metadata/** for now because we use it to access internal members -->
<PropertyGroup>
<DotNetRuntimeFiles>Vendors/System.Collections.Immutable/**;Vendors/System.Memory/**;Vendors/System.Runtime.CompilerServices.Unsafe/**</DotNetRuntimeFiles>
<DotNetRuntimeFiles>Vendors/System.Collections.Immutable/**;Vendors/System.Memory/**;Vendors/System.Private.CoreLib/**;Vendors/System.Reflection.Metadata/**;Vendors/System.Runtime.CompilerServices.Unsafe/**</DotNetRuntimeFiles>
</PropertyGroup>

<ItemGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible($(TargetFramework), 'netcoreapp3.1'))">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
using System.Threading;
using System.Threading.Tasks;
using Datadog.Trace.Vendors.MessagePack;
using Fnv1aHash = Datadog.Trace.VendoredMicrosoftCode.System.Reflection.Internal.Hash;

#nullable enable
namespace Datadog.Trace.Debugger.ExceptionAutoInstrumentation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using Fnv1aHash = Datadog.Trace.VendoredMicrosoftCode.System.Reflection.Internal.Hash;

#nullable enable
namespace Datadog.Trace.Debugger.ExceptionAutoInstrumentation
Expand All @@ -33,7 +32,7 @@ internal int NormalizeAndHashException(string exceptionString, string outerExcep
throw new ArgumentException(@"Exception string cannot be null or empty", nameof(exceptionString));
}

var fnvHashCode = HashLine(outerExceptionType.AsSpan(), Fnv1aHash.FnvOffsetBias);
var fnvHashCode = HashLine(outerExceptionType.AsSpan(), SimpleHash.FnvOffsetBias);

if (innerExceptionType != null)
{
Expand Down Expand Up @@ -93,7 +92,7 @@ protected virtual int HashLine(ReadOnlySpan<char> line, int fnvHashCode)
{
for (var i = 0; i < line.Length; i++)
{
fnvHashCode = Fnv1aHash.Combine((uint)line[i], fnvHashCode);
fnvHashCode = SimpleHash.Combine((uint)line[i], fnvHashCode);
}

return fnvHashCode;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
using Datadog.Trace.Debugger.Sink.Models;
using Datadog.Trace.Debugger.Snapshots;
using Datadog.Trace.Logging;
using Fnv1aHash = Datadog.Trace.VendoredMicrosoftCode.System.Reflection.Internal.Hash;

#nullable enable
namespace Datadog.Trace.Debugger.ExceptionAutoInstrumentation
Expand Down Expand Up @@ -115,17 +114,17 @@ private bool EnsureLeaveHashComputed()
Array.Reverse(installedProbes);
}

var hash = Fnv1aHash.FnvOffsetBias;
var hash = SimpleHash.FnvOffsetBias;

if (installedProbes.Length != 0)
{
foreach (var probe in installedProbes)
{
hash = Fnv1aHash.Combine(probe.Method.Method.MetadataToken, hash);
hash = SimpleHash.Combine(probe.Method.Method.MetadataToken, hash);
}
}

return Fnv1aHash.Combine(ExceptionReplayProcessor.Method.Method.MetadataToken, hash);
return SimpleHash.Combine(ExceptionReplayProcessor.Method.Method.MetadataToken, hash);
}

internal void InvalidateEnterLeave()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
using Datadog.Trace.Debugger.Instrumentation.Collections;
using Datadog.Trace.Debugger.Snapshots;
using Datadog.Trace.Logging;
using Fnv1aHash = Datadog.Trace.VendoredMicrosoftCode.System.Reflection.Internal.Hash;

#nullable enable
namespace Datadog.Trace.Debugger.ExceptionAutoInstrumentation
Expand Down Expand Up @@ -71,7 +70,7 @@ public bool Process<TCapture>(ref CaptureInfo<TCapture> info, IDebuggerSnapshotC
case MethodState.EntryAsync:
shadowStack = ShadowStackHolder.EnsureShadowStackEnabled();
var currentFrame = shadowStack.CurrentStackFrameNode;
snapshotCreator.EnterHash = Fnv1aHash.Combine(info.Method.MetadataToken, shadowStack.CurrentStackFrameNode?.EnterSequenceHash ?? Fnv1aHash.FnvOffsetBias);
snapshotCreator.EnterHash = SimpleHash.Combine(info.Method.MetadataToken, shadowStack.CurrentStackFrameNode?.EnterSequenceHash ?? SimpleHash.FnvOffsetBias);

if (currentFrame?.Method == info.Method && _isMisleadingMethod)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
using Datadog.Trace.Debugger.Expressions;
using Datadog.Trace.Debugger.Instrumentation.Collections;
using Datadog.Trace.Debugger.Snapshots;
using Fnv1aHash = Datadog.Trace.VendoredMicrosoftCode.System.Reflection.Internal.Hash;

#nullable enable
namespace Datadog.Trace.Debugger.ExceptionAutoInstrumentation
Expand All @@ -35,7 +34,7 @@ protected override int ComputeLeaveSequenceHash()
return firstChild.LeaveSequenceHash;
}

return Fnv1aHash.Combine(Method.MetadataToken, Fnv1aHash.FnvOffsetBias);
return SimpleHash.Combine(Method.MetadataToken, SimpleHash.FnvOffsetBias);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
using Datadog.Trace.Debugger.Expressions;
using Datadog.Trace.Debugger.Instrumentation.Collections;
using Datadog.Trace.Debugger.Snapshots;
using Fnv1aHash = Datadog.Trace.VendoredMicrosoftCode.System.Reflection.Internal.Hash;

#nullable enable
namespace Datadog.Trace.Debugger.ExceptionAutoInstrumentation
Expand Down Expand Up @@ -54,7 +53,7 @@ public int SequenceHash
{
get
{
return Fnv1aHash.Combine(EnterSequenceHash, LeaveSequenceHash);
return SimpleHash.Combine(EnterSequenceHash, LeaveSequenceHash);
}
}

Expand Down Expand Up @@ -222,7 +221,7 @@ internal void AddScopeMember<T>(string name, Type type, T value, ScopeMemberKind

protected virtual int ComputeEnterSequenceHash()
{
return Fnv1aHash.Combine(Method.MetadataToken, _parent?.EnterSequenceHash ?? Fnv1aHash.FnvOffsetBias);
return SimpleHash.Combine(Method.MetadataToken, _parent?.EnterSequenceHash ?? SimpleHash.FnvOffsetBias);
}

/// <summary>
Expand All @@ -237,10 +236,10 @@ protected virtual int ComputeLeaveSequenceHash()
if (ActiveChildNodes?.Count > 0)
{
var firstChild = ActiveChildNodes.First();
return Fnv1aHash.Combine(Method.MetadataToken, firstChild.LeaveSequenceHash);
return SimpleHash.Combine(Method.MetadataToken, firstChild.LeaveSequenceHash);
}

return Fnv1aHash.Combine(Method.MetadataToken, Fnv1aHash.FnvOffsetBias);
return SimpleHash.Combine(Method.MetadataToken, SimpleHash.FnvOffsetBias);
}
}

Expand Down
Loading
Loading