Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mvid and mdtoken to callstackframe #6839

Merged
merged 18 commits into from
Jun 19, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,24 @@ public class StacksTests
private readonly TemporaryDirectory _tempDirectory;

private const string ExpectedModule = @"Microsoft.Diagnostics.Monitoring.UnitTestApp.dll";
private static readonly Guid ExpectedModuleVersionId = new Guid("b271d014-2be3-4972-9835-7523a19ecff8");
private const string ExpectedClass = @"Microsoft.Diagnostics.Monitoring.UnitTestApp.Scenarios.StacksWorker+StacksWorkerNested`1[System.Int32]";
private const string ExpectedFunction = @"DoWork[System.Int64]";
private const string ExpectedTextFunction = @"DoWork[Int64]";
private const uint ExpectedFunctionMethodToken = 100663577;
private const string ExpectedCallbackFunction = @"Callback";
private const uint ExpectedCallbackMethodToken = 100663578;
private const string NativeFrame = "[NativeFrame]";
private const string ExpectedThreadName = "TestThread";

private static MethodInfo GetMethodInfo(string methodName)
{
// Strip off any generic type information. Pseudo frames (eg. [NativeFrame]) will return null anyways.
if (methodName.Contains('['))
{
methodName = methodName[..methodName.IndexOf('[')];
}

WilliamXieMSFT marked this conversation as resolved.
Show resolved Hide resolved
return typeof(Microsoft.Diagnostics.Monitoring.UnitTestApp.Scenarios.StacksWorker.StacksWorkerNested<int>).GetMethod(methodName);
}

public StacksTests(ITestOutputHelper outputHelper, ServiceProviderFixture serviceProviderFixture)
{
_httpClientFactory = serviceProviderFixture.ServiceProvider.GetService<IHttpClientFactory>();
Expand Down Expand Up @@ -455,12 +463,17 @@ await appRunner.ExecuteAsync(async () =>
private static string FormatFrame(string module, string @class, string function) =>
FormattableString.Invariant($"{module}!{@class}.{function}");

private static bool AreFramesEqual(WebApi.Models.CallStackFrame left, WebApi.Models.CallStackFrame right) =>
(left.ModuleName == right.ModuleName) &&
(left.TypeName == right.TypeName) &&
(left.MethodName == right.MethodName) &&
(left.MethodToken == right.MethodToken) &&
(left.ModuleVersionId == right.ModuleVersionId);
private static bool AreFramesEqual(WebApi.Models.CallStackFrame expected, WebApi.Models.CallStackFrame actual)
{
MethodInfo expectedMethodInfo = GetMethodInfo(expected.MethodName);

return (expected.ModuleName == actual.ModuleName) &&
(expected.TypeName == actual.TypeName) &&
(expected.MethodName == actual.MethodName) &&
((expectedMethodInfo?.MetadataToken ?? 0) == actual.MethodToken) &&
((expectedMethodInfo?.Module.ModuleVersionId ?? Guid.Empty) == actual.ModuleVersionId);

}

private static bool AreFramesEqual(WebApi.Models.ProfileEvent left, WebApi.Models.ProfileEvent right) =>
(left.Frame == right.Frame) && (left.At == right.At) && (left.Type == right.Type);
Expand Down Expand Up @@ -545,26 +558,20 @@ private static (WebApi.Models.CallStack, IList<WebApi.Models.CallStackFrame>) Ge
new WebApi.Models.CallStackFrame
{
ModuleName = ExpectedModule,
MethodToken = ExpectedCallbackMethodToken,
TypeName = ExpectedClass,
MethodName = ExpectedCallbackFunction,
ModuleVersionId = ExpectedModuleVersionId,
},
new WebApi.Models.CallStackFrame
{
ModuleName = NativeFrame,
MethodToken = 0,
TypeName = NativeFrame,
MethodName = NativeFrame,
ModuleVersionId = Guid.Empty,
},
new WebApi.Models.CallStackFrame
{
ModuleName = ExpectedModule,
MethodToken = ExpectedFunctionMethodToken,
TypeName = ExpectedClass,
MethodName = ExpectedFunction,
ModuleVersionId = ExpectedModuleVersionId,
}
};
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using System.Runtime.CompilerServices;

Check failure on line 1 in src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/AssemblyInfo.cs

View check run for this annotation

Azure Pipelines / dotnet-monitor-ci (Build and Test Build MacOS x64 Debug)

src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/AssemblyInfo.cs#L1

src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/AssemblyInfo.cs(1,1): error IDE0073: (NETCORE_ENGINEERING_TELEMETRY=Build) A source file is missing a required header. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0073)

Check failure on line 1 in src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/AssemblyInfo.cs

View check run for this annotation

Azure Pipelines / dotnet-monitor-ci (Build and Test Build MacOS x64 Debug)

src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/AssemblyInfo.cs#L1

src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/AssemblyInfo.cs(1,1): error IDE0073: (NETCORE_ENGINEERING_TELEMETRY=Build) A source file is missing a required header. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0073)

Check failure on line 1 in src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/AssemblyInfo.cs

View check run for this annotation

Azure Pipelines / dotnet-monitor-ci (Build and Test Build MacOS x64 Debug)

src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/AssemblyInfo.cs#L1

src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/AssemblyInfo.cs(1,1): error IDE0073: (NETCORE_ENGINEERING_TELEMETRY=Build) A source file is missing a required header. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0073)

Check failure on line 1 in src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/AssemblyInfo.cs

View check run for this annotation

Azure Pipelines / dotnet-monitor-ci (Build and Test Build MacOS x64 Release)

src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/AssemblyInfo.cs#L1

src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/AssemblyInfo.cs(1,1): error IDE0073: (NETCORE_ENGINEERING_TELEMETRY=Build) A source file is missing a required header. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0073)

Check failure on line 1 in src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/AssemblyInfo.cs

View check run for this annotation

Azure Pipelines / dotnet-monitor-ci (Build and Test Build MacOS x64 Release)

src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/AssemblyInfo.cs#L1

src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/AssemblyInfo.cs(1,1): error IDE0073: (NETCORE_ENGINEERING_TELEMETRY=Build) A source file is missing a required header. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0073)

Check failure on line 1 in src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/AssemblyInfo.cs

View check run for this annotation

Azure Pipelines / dotnet-monitor-ci (Build and Test Build MacOS x64 Release)

src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/AssemblyInfo.cs#L1

src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/AssemblyInfo.cs(1,1): error IDE0073: (NETCORE_ENGINEERING_TELEMETRY=Build) A source file is missing a required header. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0073)

Check failure on line 1 in src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/AssemblyInfo.cs

View check run for this annotation

Azure Pipelines / dotnet-monitor-ci (Build and Test Build Linux_Musl x64 Debug)

src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/AssemblyInfo.cs#L1

src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/AssemblyInfo.cs(1,1): error IDE0073: (NETCORE_ENGINEERING_TELEMETRY=Build) A source file is missing a required header. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0073)

Check failure on line 1 in src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/AssemblyInfo.cs

View check run for this annotation

Azure Pipelines / dotnet-monitor-ci (Build and Test Build Linux_Musl x64 Debug)

src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/AssemblyInfo.cs#L1

src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/AssemblyInfo.cs(1,1): error IDE0073: (NETCORE_ENGINEERING_TELEMETRY=Build) A source file is missing a required header. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0073)

Check failure on line 1 in src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/AssemblyInfo.cs

View check run for this annotation

Azure Pipelines / dotnet-monitor-ci (Build and Test Build Linux_Musl x64 Debug)

src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/AssemblyInfo.cs#L1

src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/AssemblyInfo.cs(1,1): error IDE0073: (NETCORE_ENGINEERING_TELEMETRY=Build) A source file is missing a required header. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0073)

Check failure on line 1 in src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/AssemblyInfo.cs

View check run for this annotation

Azure Pipelines / dotnet-monitor-ci (Build and Test Build MacOS arm64 Release)

src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/AssemblyInfo.cs#L1

src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/AssemblyInfo.cs(1,1): error IDE0073: (NETCORE_ENGINEERING_TELEMETRY=Build) A source file is missing a required header. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0073)

Check failure on line 1 in src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/AssemblyInfo.cs

View check run for this annotation

Azure Pipelines / dotnet-monitor-ci (Build and Test Build MacOS arm64 Release)

src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/AssemblyInfo.cs#L1

src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/AssemblyInfo.cs(1,1): error IDE0073: (NETCORE_ENGINEERING_TELEMETRY=Build) A source file is missing a required header. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0073)

Check failure on line 1 in src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/AssemblyInfo.cs

View check run for this annotation

Azure Pipelines / dotnet-monitor-ci (Build and Test Build MacOS arm64 Release)

src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/AssemblyInfo.cs#L1

src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/AssemblyInfo.cs(1,1): error IDE0073: (NETCORE_ENGINEERING_TELEMETRY=Build) A source file is missing a required header. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0073)

Check failure on line 1 in src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/AssemblyInfo.cs

View check run for this annotation

Azure Pipelines / dotnet-monitor-ci (Build and Test Build Linux_Musl x64 Release)

src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/AssemblyInfo.cs#L1

src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/AssemblyInfo.cs(1,1): error IDE0073: (NETCORE_ENGINEERING_TELEMETRY=Build) A source file is missing a required header. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0073)

Check failure on line 1 in src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/AssemblyInfo.cs

View check run for this annotation

Azure Pipelines / dotnet-monitor-ci (Build and Test Build Linux_Musl x64 Release)

src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/AssemblyInfo.cs#L1

src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/AssemblyInfo.cs(1,1): error IDE0073: (NETCORE_ENGINEERING_TELEMETRY=Build) A source file is missing a required header. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0073)

Check failure on line 1 in src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/AssemblyInfo.cs

View check run for this annotation

Azure Pipelines / dotnet-monitor-ci (Build and Test Build Linux_Musl x64 Release)

src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/AssemblyInfo.cs#L1

src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/AssemblyInfo.cs(1,1): error IDE0073: (NETCORE_ENGINEERING_TELEMETRY=Build) A source file is missing a required header. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0073)

Check failure on line 1 in src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/AssemblyInfo.cs

View check run for this annotation

Azure Pipelines / dotnet-monitor-ci (Build and Test Build Linux x64 Debug)

src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/AssemblyInfo.cs#L1

src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/AssemblyInfo.cs(1,1): error IDE0073: (NETCORE_ENGINEERING_TELEMETRY=Build) A source file is missing a required header. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0073)

Check failure on line 1 in src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/AssemblyInfo.cs

View check run for this annotation

Azure Pipelines / dotnet-monitor-ci (Build and Test Build Linux x64 Debug)

src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/AssemblyInfo.cs#L1

src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/AssemblyInfo.cs(1,1): error IDE0073: (NETCORE_ENGINEERING_TELEMETRY=Build) A source file is missing a required header. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0073)

Check failure on line 1 in src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/AssemblyInfo.cs

View check run for this annotation

Azure Pipelines / dotnet-monitor-ci (Build and Test Build Linux x64 Debug)

src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/AssemblyInfo.cs#L1

src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/AssemblyInfo.cs(1,1): error IDE0073: (NETCORE_ENGINEERING_TELEMETRY=Build) A source file is missing a required header. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0073)

Check failure on line 1 in src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/AssemblyInfo.cs

View check run for this annotation

Azure Pipelines / dotnet-monitor-ci (Build and Test Build Linux x64 Release)

src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/AssemblyInfo.cs#L1

src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/AssemblyInfo.cs(1,1): error IDE0073: (NETCORE_ENGINEERING_TELEMETRY=Build) A source file is missing a required header. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0073)

Check failure on line 1 in src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/AssemblyInfo.cs

View check run for this annotation

Azure Pipelines / dotnet-monitor-ci (Build and Test Build Linux x64 Release)

src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/AssemblyInfo.cs#L1

src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/AssemblyInfo.cs(1,1): error IDE0073: (NETCORE_ENGINEERING_TELEMETRY=Build) A source file is missing a required header. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0073)

Check failure on line 1 in src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/AssemblyInfo.cs

View check run for this annotation

Azure Pipelines / dotnet-monitor-ci (Build and Test Build Linux x64 Release)

src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/AssemblyInfo.cs#L1

src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/AssemblyInfo.cs(1,1): error IDE0073: (NETCORE_ENGINEERING_TELEMETRY=Build) A source file is missing a required header. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0073)

Check failure on line 1 in src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/AssemblyInfo.cs

View check run for this annotation

Azure Pipelines / dotnet-monitor-ci (Build and Test Build Linux arm64 Release)

src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/AssemblyInfo.cs#L1

src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/AssemblyInfo.cs(1,1): error IDE0073: (NETCORE_ENGINEERING_TELEMETRY=Build) A source file is missing a required header. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0073)

Check failure on line 1 in src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/AssemblyInfo.cs

View check run for this annotation

Azure Pipelines / dotnet-monitor-ci (Build and Test Build Linux arm64 Release)

src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/AssemblyInfo.cs#L1

src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/AssemblyInfo.cs(1,1): error IDE0073: (NETCORE_ENGINEERING_TELEMETRY=Build) A source file is missing a required header. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0073)

Check failure on line 1 in src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/AssemblyInfo.cs

View check run for this annotation

Azure Pipelines / dotnet-monitor-ci (Build and Test Build Linux arm64 Release)

src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/AssemblyInfo.cs#L1

src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/AssemblyInfo.cs(1,1): error IDE0073: (NETCORE_ENGINEERING_TELEMETRY=Build) A source file is missing a required header. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0073)

Check failure on line 1 in src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/AssemblyInfo.cs

View check run for this annotation

Azure Pipelines / dotnet-monitor-ci (Build and Test Build Linux_Musl arm64 Release)

src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/AssemblyInfo.cs#L1

src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/AssemblyInfo.cs(1,1): error IDE0073: (NETCORE_ENGINEERING_TELEMETRY=Build) A source file is missing a required header. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0073)

Check failure on line 1 in src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/AssemblyInfo.cs

View check run for this annotation

Azure Pipelines / dotnet-monitor-ci (Build and Test Build Linux_Musl arm64 Release)

src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/AssemblyInfo.cs#L1

src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/AssemblyInfo.cs(1,1): error IDE0073: (NETCORE_ENGINEERING_TELEMETRY=Build) A source file is missing a required header. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0073)

Check failure on line 1 in src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/AssemblyInfo.cs

View check run for this annotation

Azure Pipelines / dotnet-monitor-ci (Build and Test Build Linux_Musl arm64 Release)

src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/AssemblyInfo.cs#L1

src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/AssemblyInfo.cs(1,1): error IDE0073: (NETCORE_ENGINEERING_TELEMETRY=Build) A source file is missing a required header. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0073)
using System.Runtime.InteropServices;

// In SDK-style projects such as this one, several assembly attributes that were historically
// defined in this file are now automatically added during build and populated with
// values defined in project properties. For details of which attributes are included
// and how to customise this process see: https://aka.ms/assembly-info-properties


// Setting ComVisible to false makes the types in this assembly not visible to COM
// components. If you need to access a type in this assembly from COM, set the ComVisible
// attribute to true on that type.

[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM.

[assembly: Guid("67036149-b174-4033-a15f-ed5079896dfb")]

[assembly:InternalsVisibleTo("Microsoft.Diagnostics.Monitoring.Tool.FunctionalTests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")]
WilliamXieMSFT marked this conversation as resolved.
Show resolved Hide resolved
Loading