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

Macos dumps #2495

Merged
merged 4 commits into from
Jul 29, 2020
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
3 changes: 2 additions & 1 deletion NuGet.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageRestore>
<add key="enabled" value="True" />
Expand All @@ -14,6 +14,7 @@
<add key="mstest.myget" value="https://dotnet.myget.org/F/mstestv2/api/v3/index.json" />
<add key="pdb2pdb.myget" value="https://dotnet.myget.org/F/symreader-converter/api/v3/index.json" />
<add key="vsunittesting.myget" value="https://dotnet.myget.org/F/vsunittesting/api/v3/index.json" />
<add key="dotnet5" value="https://dnceng.pkgs.visualstudio.com/public/_packaging/dotnet5/nuget/v3/index.json" />
</packageSources>
<fallbackPackageFolders>
<clear />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,19 @@ public IHangDumper Create(string targetFramework)
return new NetClientDumper();
}

// this is not supported yet
// if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
// {

// if (frameworkVersion != default && frameworkVersion <= new Version("5.0"))
// {
// return new SigtrapDumper();
// }

// EqtTrace.Info($"HangDumperFactory: This is OSX on netcoreapp3.1 or newer, returning the standard NETClient library dumper.");
// return new NetClientDumper();
// }
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
{
if (!string.IsNullOrWhiteSpace(targetFramework) && !targetFramework.Contains("v5.0"))
nohwnd marked this conversation as resolved.
Show resolved Hide resolved
{
EqtTrace.Info($"HangDumperFactory: This is OSX on {targetFramework}, This combination of OS and framework is not supported.");

throw new PlatformNotSupportedException($"Unsupported target framework {targetFramework} on OS {RuntimeInformation.OSDescription}");
}

EqtTrace.Info($"HangDumperFactory: This is OSX on net5.0 or newer, returning the standard NETClient library dumper.");
return new NetClientDumper();
}

throw new PlatformNotSupportedException($"Unsupported operating system: {RuntimeInformation.OSDescription}");
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Diagnostics.NETCore.Client">
<Version>0.2.0-preview.20220.1</Version>
<Version>0.2.0-preview.20378.10</Version>
</PackageReference>
<PackageReference Include="NETStandard.Library" Version="2.0.3" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,17 @@
namespace Microsoft.TestPlatform.Extensions.BlameDataCollector
{
using Microsoft.Diagnostics.NETCore.Client;
using Microsoft.VisualStudio.TestPlatform.ObjectModel;

internal class NetClientDumper : IHangDumper
{
public void Dump(int processId, string outputFile, DumpTypeOption type)
{
var client = new DiagnosticsClient(processId);
client.WriteDump(type == DumpTypeOption.Full ? DumpType.Full : DumpType.Normal, outputFile);

// Connecting the dump generation logging to verbose output to avoid changing the interfaces again
// before we test this on some big repo.
client.WriteDump(type == DumpTypeOption.Full ? DumpType.Full : DumpType.Normal, outputFile, logDumpGeneration: EqtTrace.IsVerboseEnabled);
}
}
}