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

Merge main into release branch #2444

Merged
merged 102 commits into from
Jul 20, 2021
Merged
Changes from 1 commit
Commits
Show all changes
102 commits
Select commit Hold shift + click to select a range
1c9714c
Update dependencies from https://github.com/dotnet/aspnetcore build 2…
dotnet-maestro[bot] May 27, 2021
92bffb2
Update dependencies from https://github.com/dotnet/runtime build 2021…
dotnet-maestro[bot] May 27, 2021
bec3757
Update dependencies from https://github.com/dotnet/aspnetcore build 2…
dotnet-maestro[bot] May 28, 2021
3ccfb52
[main] Update dependencies from dotnet/runtime (#2321)
dotnet-maestro[bot] May 30, 2021
4a77751
Update dependencies from https://github.com/dotnet/aspnetcore build 2…
dotnet-maestro[bot] May 30, 2021
5114029
Update dependencies from https://github.com/dotnet/aspnetcore build 2…
dotnet-maestro[bot] May 31, 2021
11f712d
Update dependencies from https://github.com/dotnet/runtime build 2021…
dotnet-maestro[bot] May 31, 2021
2624296
Update dependencies from https://github.com/dotnet/runtime build 2021…
dotnet-maestro[bot] Jun 1, 2021
deda636
Update dependencies from https://github.com/dotnet/aspnetcore build 2…
dotnet-maestro[bot] Jun 1, 2021
e85eba2
Update dependencies from https://github.com/dotnet/aspnetcore build 2…
dotnet-maestro[bot] Jun 2, 2021
17f22ce
Update dependencies from https://github.com/dotnet/runtime build 2021…
dotnet-maestro[bot] Jun 2, 2021
1e330f4
Update dependencies from https://github.com/dotnet/runtime build 2021…
dotnet-maestro[bot] Jun 3, 2021
31c28f2
Update dependencies from https://github.com/dotnet/aspnetcore build 2…
dotnet-maestro[bot] Jun 3, 2021
dd57ff4
Update dependencies from https://github.com/dotnet/aspnetcore build 2…
dotnet-maestro[bot] Jun 4, 2021
875e243
Update dependencies from https://github.com/microsoft/clrmd build 202…
dotnet-maestro[bot] Jun 4, 2021
2b97d46
Update dependencies from https://github.com/dotnet/runtime build 2021…
dotnet-maestro[bot] Jun 4, 2021
564de98
Update dependencies from https://github.com/dotnet/runtime build 2021…
dotnet-maestro[bot] Jun 5, 2021
9018382
Update dependencies from https://github.com/dotnet/runtime build 2021…
dotnet-maestro[bot] Jun 5, 2021
9201cf9
Update dependencies from https://github.com/dotnet/aspnetcore build 2…
dotnet-maestro[bot] Jun 5, 2021
080d27e
Fix a NullRefException by finished process (#2338)
sywhang Jun 6, 2021
7a29429
Update dependencies from https://github.com/dotnet/aspnetcore build 2…
dotnet-maestro[bot] Jun 6, 2021
ef437fe
Update dependencies from https://github.com/dotnet/runtime build 2021…
dotnet-maestro[bot] Jun 6, 2021
f9e24b0
Update dependencies from https://github.com/dotnet/aspnetcore build 2…
dotnet-maestro[bot] Jun 7, 2021
73d2fa7
Update dependencies from https://github.com/dotnet/runtime build 2021…
dotnet-maestro[bot] Jun 7, 2021
71320cd
Update dependencies from https://github.com/dotnet/aspnetcore build 2…
dotnet-maestro[bot] Jun 8, 2021
1cad2e2
Update dependencies from https://github.com/dotnet/runtime build 2021…
dotnet-maestro[bot] Jun 8, 2021
62fdde2
Update dependencies from https://github.com/dotnet/aspnetcore build 2…
dotnet-maestro[bot] Jun 9, 2021
0c9868f
Update dependencies from https://github.com/dotnet/runtime build 2021…
dotnet-maestro[bot] Jun 9, 2021
5555d2a
Update dependencies from https://github.com/dotnet/aspnetcore build 2…
dotnet-maestro[bot] Jun 10, 2021
9682de2
Update dependencies from https://github.com/dotnet/runtime build 2021…
dotnet-maestro[bot] Jun 10, 2021
3d57bee
Update `ThreadCounts` usage based on a change (#2324)
kouvel Jun 10, 2021
2e4a0c0
Remove the CLRMD dependency from Microsoft.Diagnostics.DebugServices …
mikem8361 Jun 11, 2021
fffa91f
Update dependencies from https://github.com/dotnet/aspnetcore build 2…
dotnet-maestro[bot] Jun 11, 2021
74a1057
Update dependencies from https://github.com/dotnet/runtime build 2021…
dotnet-maestro[bot] Jun 11, 2021
cf90c50
Update dependencies from https://github.com/dotnet/aspnetcore build 2…
dotnet-maestro[bot] Jun 12, 2021
6e53498
Update dependencies from https://github.com/dotnet/runtime build 2021…
dotnet-maestro[bot] Jun 12, 2021
6200057
Update dependencies from https://github.com/dotnet/aspnetcore build 2…
dotnet-maestro[bot] Jun 13, 2021
b1420fc
Add IVT for Microsoft.Diagnostics.Monitoring.WebApi (#2355)
jander-msft Jun 15, 2021
605d548
[main] Update dependencies from dotnet/runtime (#2364)
dotnet-maestro[bot] Jun 16, 2021
24d52ed
[main] Update dependencies from dotnet/runtime (#2372)
dotnet-maestro[bot] Jun 17, 2021
2972bc3
[main] Update dependencies from dotnet/aspnetcore (#2365)
dotnet-maestro[bot] Jun 18, 2021
b6df99f
Update dependencies from https://github.com/dotnet/runtime build 2021…
dotnet-maestro[bot] Jun 18, 2021
7b253a5
Add runtime resume option to dotnet-trace and dotnet-counters. (#2343)
lateralusX Jun 18, 2021
5e747b4
Update dependencies from https://github.com/dotnet/aspnetcore build 2…
dotnet-maestro[bot] Jun 19, 2021
ac80218
Update dependencies from https://github.com/dotnet/runtime build 2021…
dotnet-maestro[bot] Jun 19, 2021
29e7946
Update dependencies from https://github.com/dotnet/aspnetcore build 2…
dotnet-maestro[bot] Jun 20, 2021
ca79977
Update dependencies from https://github.com/dotnet/runtime build 2021…
dotnet-maestro[bot] Jun 20, 2021
3451a6d
Update dependencies from https://github.com/dotnet/runtime build 2021…
dotnet-maestro[bot] Jun 21, 2021
aa0200f
[main] Update dependencies from dotnet/runtime (#2384)
dotnet-maestro[bot] Jun 23, 2021
92fdadf
[main] Update dependencies from dotnet/aspnetcore (#2383)
dotnet-maestro[bot] Jun 23, 2021
296bda6
Add adb port forward and usbmux support to dsrouter. (#2366)
lateralusX Jun 23, 2021
250740a
Updates scripts for LLVM/Clang versions that are double digits (#2386)
Thefrank Jun 24, 2021
ed4c547
Update dependencies from https://github.com/dotnet/runtime build 2021…
dotnet-maestro[bot] Jun 24, 2021
f7d2b85
Update dependencies from https://github.com/dotnet/aspnetcore build 2…
dotnet-maestro[bot] Jun 24, 2021
9ddcba5
Fix build break on xcode 12 (#2390)
mikem8361 Jun 25, 2021
084ef2c
Update dependencies from https://github.com/dotnet/aspnetcore build 2…
dotnet-maestro[bot] Jun 25, 2021
038c84f
Update dependencies from https://github.com/dotnet/runtime build 2021…
dotnet-maestro[bot] Jun 25, 2021
6f48c2a
Use a different way of recognizing a GC build using regions that work…
PeterSolMS Jun 25, 2021
c088402
Update dependencies from https://github.com/dotnet/aspnetcore build 2…
dotnet-maestro[bot] Jun 26, 2021
fa415c4
Update dependencies from https://github.com/dotnet/runtime build 2021…
dotnet-maestro[bot] Jun 26, 2021
a9389e9
Update dependencies from https://github.com/dotnet/runtime build 2021…
dotnet-maestro[bot] Jun 27, 2021
e80ec9d
Update dependencies from https://github.com/dotnet/runtime build 2021…
dotnet-maestro[bot] Jun 28, 2021
dfb97e8
Add new DiagnosticClient commands for IPC features (#2268)
davmason Jun 28, 2021
8e7cb4c
Update dependencies from https://github.com/dotnet/runtime build 2021…
dotnet-maestro[bot] Jun 29, 2021
a584d05
Update dependencies from https://github.com/dotnet/aspnetcore build 2…
dotnet-maestro[bot] Jun 29, 2021
ad0806f
Update dependencies from https://github.com/dotnet/aspnetcore build 2…
dotnet-maestro[bot] Jun 30, 2021
74ee166
Update dependencies from https://github.com/dotnet/runtime build 2021…
dotnet-maestro[bot] Jun 30, 2021
7f2fffa
Remove endpoint info, runtime info, and command line helper. (#2371)
jander-msft Jul 1, 2021
b1d8624
Add GetProcessInfo2 command, response, tests, and docs. (#2360)
jander-msft Jul 1, 2021
2307658
Update dependencies from https://github.com/dotnet/aspnetcore build 2…
dotnet-maestro[bot] Jul 1, 2021
1704288
Update dependencies from https://github.com/dotnet/runtime build 2021…
dotnet-maestro[bot] Jul 1, 2021
4e85e56
Update dependencies from https://github.com/dotnet/runtime build 2021…
dotnet-maestro[bot] Jul 2, 2021
bc777c8
Update dependencies from https://github.com/dotnet/aspnetcore build 2…
dotnet-maestro[bot] Jul 2, 2021
6296c96
Update DumpObj command to show TrackedType and TaggedMemory (#2407)
AaronRobinsonMSFT Jul 2, 2021
f4b0a88
Update dependencies from https://github.com/dotnet/aspnetcore build 2…
dotnet-maestro[bot] Jul 3, 2021
b7544d9
Update dependencies from https://github.com/dotnet/runtime build 2021…
dotnet-maestro[bot] Jul 3, 2021
4be19c7
Update dependencies from https://github.com/dotnet/runtime build 2021…
dotnet-maestro[bot] Jul 5, 2021
b9f2ffb
Update dependencies from https://github.com/dotnet/aspnetcore build 2…
dotnet-maestro[bot] Jul 5, 2021
f31ff2e
Clean up error code used by dotnet-counters and dotnet-trace (#2412)
sywhang Jul 6, 2021
aa95d90
Update dependencies from https://github.com/dotnet/runtime build 2021…
dotnet-maestro[bot] Jul 6, 2021
b0fbc75
Update dependencies from https://github.com/dotnet/aspnetcore build 2…
dotnet-maestro[bot] Jul 6, 2021
d6236fa
Add dsrouter client-client mode. (#2385)
lateralusX Jul 6, 2021
759138b
Fix DSRouter build break in diag client (#2421)
hoyosjs Jul 7, 2021
c40b61d
Update dependencies from https://github.com/dotnet/aspnetcore build 2…
dotnet-maestro[bot] Jul 7, 2021
794e2b7
Update dependencies from https://github.com/dotnet/runtime build 2021…
dotnet-maestro[bot] Jul 7, 2021
715a291
fix building native component for FreeBSD (#2419)
Thefrank Jul 7, 2021
2a4c122
Implement tooling support to connect using custom IPC channels. (#2374)
lateralusX Jul 8, 2021
5933cd8
Update dependencies from https://github.com/dotnet/aspnetcore build 2…
dotnet-maestro[bot] Jul 8, 2021
429f3b7
Update dependencies from https://github.com/dotnet/runtime build 2021…
dotnet-maestro[bot] Jul 8, 2021
fb5af08
Disable dsrouter single-file publish (#2337)
hoyosjs Jul 9, 2021
85aa8c9
Update dependencies from https://github.com/dotnet/aspnetcore build 2…
dotnet-maestro[bot] Jul 9, 2021
0645689
Update dependencies from https://github.com/dotnet/runtime build 2021…
dotnet-maestro[bot] Jul 9, 2021
086d6ed
Update dependencies from https://github.com/dotnet/aspnetcore build 2…
dotnet-maestro[bot] Jul 10, 2021
1e8c64e
Update dependencies from https://github.com/dotnet/runtime build 2021…
dotnet-maestro[bot] Jul 10, 2021
82c004f
Update dependencies from https://github.com/dotnet/aspnetcore build 2…
dotnet-maestro[bot] Jul 11, 2021
a01d3e9
[main] Update dependencies from dotnet/runtime (#2432)
dotnet-maestro[bot] Jul 12, 2021
2b2a188
Remove erroneous mentions of reverse server in comments (#2433)
davmason Jul 13, 2021
4d3906d
Update dependencies from https://github.com/dotnet/aspnetcore build 2…
dotnet-maestro[bot] Jul 13, 2021
419db65
Update dependencies from https://github.com/dotnet/aspnetcore build 2…
dotnet-maestro[bot] Jul 14, 2021
ce3b20d
Fix clrstack -i crash (#2440)
mikem8361 Jul 16, 2021
9a79ec2
Fix fallback for resumeruntime (#2441)
Jul 20, 2021
8cffa1d
Merge branch 'main' into release/stable
hoyosjs Jul 20, 2021
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
Prev Previous commit
Next Next commit
Add new DiagnosticClient commands for IPC features (#2268)
davmason authored Jun 28, 2021
commit dfb97e8c4561f5ef40b7853faa6f1ca9b5d8f8c9
26 changes: 24 additions & 2 deletions documentation/diagnostics-client-library-instructions.md
Original file line number Diff line number Diff line change
@@ -224,14 +224,36 @@ public static void PrintEventsLive(int processId)

This sample shows how to attach an ICorProfiler to a process (profiler attach).
```cs
public static int AttachProfiler(int processId, Guid profilerGuid, string profilerPath)
public static void AttachProfiler(int processId, Guid profilerGuid, string profilerPath)
{
var client = new DiagnosticsClient(processId);
return client.AttachProfiler(TimeSpan.FromSeconds(10), profilerGuid, profilerPath);
client.AttachProfiler(TimeSpan.FromSeconds(10), profilerGuid, profilerPath);
}
```

#### 8. Set an ICorProfiler to be used as the startup profiler

This sample shows how to request that the runtime use an ICorProfiler as the startup profiler (not as an attaching profiler). It is only valid to issue this command while the runtime is paused in "reverse server" mode.

```cs
public static void SetStartupProfilerProfiler(Guid profilerGuid, string profilerPath)
{
var client = new DiagnosticsClient(processId);
client.SetStartupProfiler(profilerGuid, profilerPath);
}
```

#### 9. Resume the runtime when it is paused in reverse server mode

This sample shows how a client can instruct the runtime to resume loading after it has been paused in "reverse server" mode.

```cs
public static void ResumeRuntime(Guid profilerGuid, string profilerPath)
{
var client = new DiagnosticsClient(processId);
client.ResumeRuntime();
}
```

## API Description

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -51,12 +51,14 @@ internal enum DumpCommandId : byte
internal enum ProfilerCommandId : byte
{
AttachProfiler = 0x01,
StartupProfiler = 0x02,
}

internal enum ProcessCommandId : byte
{
GetProcessInfo = 0x00,
ResumeRuntime = 0x01,
GetProcessEnvironment = 0x02,
SetEnvironmentVariable = 0x03,
}
}
Original file line number Diff line number Diff line change
@@ -15,11 +15,12 @@ namespace Microsoft.Diagnostics.NETCore.Client
/// </summary>
internal enum DiagnosticsIpcError : uint
{
InvalidArgument = 0x80070057,
ProfilerAlreadyActive = 0x8013136A,
BadEncoding = 0x80131384,
UnknownCommand = 0x80131385,
UnknownMagic = 0x80131386,
UnknownError = 0x80131387
UnknownError = 0x80131387,
}

/// <summary>
Original file line number Diff line number Diff line change
@@ -42,26 +42,14 @@ public static ProcessEnvironmentHelper Parse(byte[] payload)
cursor += sizeof(UInt32);
while (cursor < envBlock.Length)
{
string pair = ReadString(envBlock, ref cursor);
string pair = IpcHelpers.ReadString(envBlock, ref cursor);
int equalsIdx = pair.IndexOf('=');
env[pair.Substring(0,equalsIdx)] = equalsIdx != pair.Length - 1 ? pair.Substring(equalsIdx+1) : "";
}

return env;
}

private static string ReadString(byte[] buffer, ref int index)
{
// Length of the string of UTF-16 characters
int length = (int)BitConverter.ToUInt32(buffer, index);
index += sizeof(UInt32);

int size = (int)length * sizeof(char);
// The string contains an ending null character; remove it before returning the value
string value = Encoding.Unicode.GetString(buffer, index, size).Substring(0, length - 1);
index += size;
return value;
}

private UInt32 ExpectedSizeInBytes { get; set; }
private UInt16 Future { get; set; }
Original file line number Diff line number Diff line change
@@ -40,26 +40,13 @@ public static ProcessInfo Parse(byte[] payload)
processInfo.RuntimeInstanceCookie = new Guid(cookieBuffer);
index += GuidSizeInBytes;

processInfo.CommandLine = ReadString(payload, ref index);
processInfo.OperatingSystem = ReadString(payload, ref index);
processInfo.ProcessArchitecture = ReadString(payload, ref index);
processInfo.CommandLine = IpcHelpers.ReadString(payload, ref index);
processInfo.OperatingSystem = IpcHelpers.ReadString(payload, ref index);
processInfo.ProcessArchitecture = IpcHelpers.ReadString(payload, ref index);

return processInfo;
}

private static string ReadString(byte[] buffer, ref int index)
{
// Length of the string of UTF-16 characters
int length = (int)BitConverter.ToUInt32(buffer, index);
index += sizeof(UInt32);

int size = (int)length * sizeof(char);
// The string contains an ending null character; remove it before returning the value
string value = Encoding.Unicode.GetString(buffer, index, size).Substring(0, length - 1);
index += size;
return value;
}

public UInt64 ProcessId { get; private set; }
public Guid RuntimeInstanceCookie { get; private set; }
public string CommandLine { get; private set; }
22 changes: 22 additions & 0 deletions src/Microsoft.Diagnostics.NETCore.Client/IpcHelpers.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace Microsoft.Diagnostics.NETCore.Client
{
internal static class IpcHelpers
{
public static string ReadString(byte[] buffer, ref int index)
{
// Length of the string of UTF-16 characters
int length = (int)BitConverter.ToUInt32(buffer, index);
index += sizeof(UInt32);

int size = (int)length * sizeof(char);
// The string contains an ending null character; remove it before returning the value
string value = Encoding.Unicode.GetString(buffer, index, size).Substring(0, length - 1);
index += size;
return value;
}
}
}
Original file line number Diff line number Diff line change
@@ -4,13 +4,15 @@


using System;
using System.Linq;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Runtime.InteropServices;
using System.Threading;
using System.Threading.Tasks;
using Xunit.Abstractions;
using System.Collections.Generic;

namespace Microsoft.Diagnostics.NETCore.Client
{
@@ -22,13 +24,14 @@ public class TestRunner : IDisposable
private CancellationTokenSource cts;

public TestRunner(string testExePath, ITestOutputHelper _outputHelper = null,
bool redirectError = false, bool redirectInput = false)
bool redirectError = false, bool redirectInput = false, Dictionary<string, string> envVars = null)
{
startInfo = new ProcessStartInfo(CommonHelper.HostExe, testExePath);
startInfo.UseShellExecute = false;
startInfo.RedirectStandardOutput = true;
startInfo.RedirectStandardError = redirectError;
startInfo.RedirectStandardInput = redirectInput;
envVars?.ToList().ForEach(item => startInfo.Environment.Add(item.Key, item.Value));
outputHelper = _outputHelper;
}