|
|
|
|
|
|
|
|
|
@@ -712,7 +712,7 @@ RETAIL_CONFIG_DWORD_INFO(INTERNAL_EventPipeProcNumbers, W("EventPipeProcNumbers" |
|
// |
|
// Diagnostics Ports |
|
// |
|
-RRETAIL_CONFIG_DWORD_INFO_EX(EXTERNAL_DOTNET_DiagnosticPortSuspend, W("DOTNET_DiagnosticPortSuspend"), 1, "This will cause the runtime to pause during startup before major subsystems are started. Resume using the Diagnostics IPC ResumeStartup command.", CLRConfig::DontPrependCOMPlus_); |
|
+RETAIL_CONFIG_DWORD_INFO_EX(EXTERNAL_DOTNET_DiagnosticPortSuspend, W("DOTNET_DiagnosticPortSuspend"), 0, "This will cause the runtime to pause during startup before major subsystems are started. Resume using the Diagnostics IPC ResumeStartup command.", CLRConfig::DontPrependCOMPlus_); |
|
RETAIL_CONFIG_STRING_INFO_EX(EXTERNAL_DOTNET_DiagnosticPorts, W("DOTNET_DiagnosticPorts"), "A semicolon delimited list of additional Diagnostic Ports, where a Diagnostic Port is a NamedPipe path without '\\\\.\\pipe\\' on Windows or the full path of Unix Domain Socket on Linux/Unix followed by optional tags, e.g., '<path>,listen,nosuspend;<path>,connect'", CLRConfig::DontPrependCOMPlus_); |
|
|
|
// |
|
|
|
|
|
|
|
|
|
@@ -15,11 +15,11 @@ CQuickArrayList<LPSTR> split(LPSTR string, LPCSTR delimiters) |
|
{ |
|
CQuickArrayList<LPSTR> parts; |
|
char *context; |
|
- char *portConfig = nullptr; |
|
+ char *part = nullptr; |
|
for (char *cursor = string; ; cursor = nullptr) |
|
{ |
|
- if ((portConfig = strtok_s(cursor, delimiters, &context)) != nullptr) |
|
- parts.Push(portConfig); |
|
+ if ((part = strtok_s(cursor, delimiters, &context)) != nullptr) |
|
+ parts.Push(part); |
|
else |
|
break; |
|
} |
|
@@ -110,11 +110,14 @@ bool IpcStreamFactory::Configure(ErrorCallback callback) |
|
|
|
ASSERT(portConfigParts.Size() >= 1); |
|
if (portConfigParts.Size() == 0) |
|
+ { |
|
+ fSuccess &= false; |
|
continue; |
|
+ } |
|
|
|
- builder.WithPath(portConfigParts.Pop()); |
|
- while (portConfigParts.Size() > 0) |
|
+ while (portConfigParts.Size() > 1) |
|
builder.WithTag(portConfigParts.Pop()); |
|
+ builder.WithPath(portConfigParts.Pop()); |
|
|
|
const bool fBuildSuccess = BuildAndAddPort(builder, callback); |
|
STRESS_LOG1(LF_DIAGNOSTICS_PORT, LL_INFO10, "IpcStreamFactory::Configure - Diagnostic Port creation succeeded? %d \n", fBuildSuccess); |
|
|
|
|
|
|
|
|
|
@@ -32,7 +32,7 @@ class IpcStreamFactory |
|
DiagnosticPortType Type = DiagnosticPortType::LISTEN; |
|
DiagnosticPortSuspendMode SuspendMode = DiagnosticPortSuspendMode::NOSUSPEND; |
|
|
|
- DiagnosticPortBuilder WithPath(LPSTR path) { Path = _strdup(path); return *this; } |
|
+ DiagnosticPortBuilder WithPath(LPSTR path) { Path = path != nullptr ? _strdup(path) : nullptr; return *this; } |
|
DiagnosticPortBuilder WithType(DiagnosticPortType type) { Type = type; return *this; } |
|
DiagnosticPortBuilder WithSuspendMode(DiagnosticPortSuspendMode mode) { SuspendMode = mode; return *this; } |
|
DiagnosticPortBuilder WithTag(LPSTR tag) |
|
|
|
|
|
|
|
|
|
@@ -21,8 +21,8 @@ namespace Tracing.Tests.Common |
|
{ |
|
public static class Utils |
|
{ |
|
- public static readonly string DiagnosticsMonitorAddressEnvKey = "DOTNET_DiagnosticsMonitorAddress"; |
|
- public static readonly string DiagnosticsMonitorPauseOnStartEnvKey = "DOTNET_DiagnosticsMonitorPauseOnStart"; |
|
+ public static readonly string DiagnosticPortsEnvKey = "DOTNET_DiagnosticPorts"; |
|
+ public static readonly string DiagnosticPortSuspend = "DOTNET_DiagnosticPortSuspend"; |
|
|
|
public static async Task<T> WaitTillTimeout<T>(Task<T> task, TimeSpan timeout) |
|
{ |
|
|
|
|
|
|
|
|
|
@@ -28,7 +28,7 @@ public static async Task<bool> TEST_RuntimeResumesExecutionWithCommand() |
|
var server = new ReverseServer(serverName); |
|
Task<bool> subprocessTask = Utils.RunSubprocess( |
|
currentAssembly: Assembly.GetExecutingAssembly(), |
|
- environment: new Dictionary<string,string> { { Utils.DiagnosticsMonitorAddressEnvKey, serverName } }, |
|
+ environment: new Dictionary<string,string> { { Utils.DiagnosticPortsEnvKey, $"{serverName},connect,suspend" } }, |
|
duringExecution: async (_) => |
|
{ |
|
Stream stream = await server.AcceptAsync(); |
|
@@ -56,7 +56,7 @@ public static async Task<bool> TEST_TracesHaveRelevantEvents() |
|
using var memoryStream = new MemoryStream(); |
|
Task<bool> subprocessTask = Utils.RunSubprocess( |
|
currentAssembly: Assembly.GetExecutingAssembly(), |
|
- environment: new Dictionary<string,string> { { Utils.DiagnosticsMonitorAddressEnvKey, serverName } }, |
|
+ environment: new Dictionary<string,string> { { Utils.DiagnosticPortsEnvKey, $"{serverName},connect,suspend" } }, |
|
duringExecution: async (pid) => |
|
{ |
|
Stream stream = await server.AcceptAsync(); |
|
@@ -114,7 +114,7 @@ public static async Task<bool> TEST_MultipleSessionsCanBeStartedWhilepaused() |
|
using var memoryStream3 = new MemoryStream(); |
|
Task<bool> subprocessTask = Utils.RunSubprocess( |
|
currentAssembly: Assembly.GetExecutingAssembly(), |
|
- environment: new Dictionary<string,string> { { Utils.DiagnosticsMonitorAddressEnvKey, serverName } }, |
|
+ environment: new Dictionary<string,string> { { Utils.DiagnosticPortsEnvKey, $"{serverName},connect,suspend" } }, |
|
duringExecution: async (pid) => |
|
{ |
|
Stream stream = await server.AcceptAsync(); |
|
@@ -207,7 +207,7 @@ public static async Task<bool> TEST_CanStartAndStopSessionWhilepaused() |
|
using var memoryStream3 = new MemoryStream(); |
|
Task<bool> subprocessTask = Utils.RunSubprocess( |
|
currentAssembly: Assembly.GetExecutingAssembly(), |
|
- environment: new Dictionary<string,string> { { Utils.DiagnosticsMonitorAddressEnvKey, serverName } }, |
|
+ environment: new Dictionary<string,string> { { Utils.DiagnosticPortsEnvKey, $"{serverName},connect,suspend" } }, |
|
duringExecution: async (pid) => |
|
{ |
|
Stream stream = await server.AcceptAsync(); |
|
@@ -271,7 +271,7 @@ public static async Task<bool> TEST_DisabledCommandsError() |
|
using var memoryStream3 = new MemoryStream(); |
|
Task<bool> subprocessTask = Utils.RunSubprocess( |
|
currentAssembly: Assembly.GetExecutingAssembly(), |
|
- environment: new Dictionary<string,string> { { Utils.DiagnosticsMonitorAddressEnvKey, serverName } }, |
|
+ environment: new Dictionary<string,string> { { Utils.DiagnosticPortsEnvKey, $"{serverName},connect,suspend" } }, |
|
duringExecution: async (pid) => |
|
{ |
|
Stream stream = await server.AcceptAsync(); |
|
|
|
|
|
|
|
|
|
@@ -28,8 +28,7 @@ public static async Task<bool> TEST_RuntimeIsResilientToServerClosing() |
|
currentAssembly: Assembly.GetExecutingAssembly(), |
|
environment: new Dictionary<string,string> |
|
{ |
|
- { Utils.DiagnosticsMonitorAddressEnvKey, serverName }, |
|
- { Utils.DiagnosticsMonitorPauseOnStartEnvKey, "0" } |
|
+ { Utils.DiagnosticPortsEnvKey, $"{serverName},connect,nosuspend" } |
|
}, |
|
duringExecution: async (_) => |
|
{ |
|
@@ -59,8 +58,7 @@ public static async Task<bool> TEST_RuntimeConnectsToExistingServer() |
|
currentAssembly: Assembly.GetExecutingAssembly(), |
|
environment: new Dictionary<string,string> |
|
{ |
|
- { Utils.DiagnosticsMonitorAddressEnvKey, serverName }, |
|
- { Utils.DiagnosticsMonitorPauseOnStartEnvKey, "0" } |
|
+ { Utils.DiagnosticPortsEnvKey, $"{serverName},connect,nosuspend" } |
|
}, |
|
duringExecution: async (_) => |
|
{ |
|
@@ -85,8 +83,7 @@ public static async Task<bool> TEST_CanConnectServerAndClientAtSameTime() |
|
currentAssembly: Assembly.GetExecutingAssembly(), |
|
environment: new Dictionary<string,string> |
|
{ |
|
- { Utils.DiagnosticsMonitorAddressEnvKey, serverName }, |
|
- { Utils.DiagnosticsMonitorPauseOnStartEnvKey, "0" } |
|
+ { Utils.DiagnosticPortsEnvKey, $"{serverName},connect,nosuspend" } |
|
}, |
|
duringExecution: async (int pid) => |
|
{ |
|
@@ -139,8 +136,7 @@ public static async Task<bool> TEST_ServerWorksIfClientDoesntAccept() |
|
currentAssembly: Assembly.GetExecutingAssembly(), |
|
environment: new Dictionary<string,string> |
|
{ |
|
- { Utils.DiagnosticsMonitorAddressEnvKey, serverName }, |
|
- { Utils.DiagnosticsMonitorPauseOnStartEnvKey, "0" } |
|
+ { Utils.DiagnosticPortsEnvKey, $"{serverName},connect,nosuspend" } |
|
}, |
|
duringExecution: async (int pid) => |
|
{ |
|
@@ -181,8 +177,7 @@ public static async Task<bool> TEST_ServerIsResilientToNoBufferAgent() |
|
currentAssembly: Assembly.GetExecutingAssembly(), |
|
environment: new Dictionary<string,string> |
|
{ |
|
- { Utils.DiagnosticsMonitorAddressEnvKey, serverName }, |
|
- { Utils.DiagnosticsMonitorPauseOnStartEnvKey, "0" } |
|
+ { Utils.DiagnosticPortsEnvKey, $"{serverName},connect,nosuspend" } |
|
}, |
|
duringExecution: async (int pid) => |
|
{ |
|
@@ -220,8 +215,7 @@ public static async Task<bool> TEST_StandardConnectionStillWorksIfReverseConnect |
|
currentAssembly: Assembly.GetExecutingAssembly(), |
|
environment: new Dictionary<string,string> |
|
{ |
|
- { Utils.DiagnosticsMonitorAddressEnvKey, serverName }, |
|
- { Utils.DiagnosticsMonitorPauseOnStartEnvKey, "0" } |
|
+ { Utils.DiagnosticPortsEnvKey, $"{serverName},connect,nosuspend" } |
|
}, |
|
duringExecution: async (int pid) => |
|
{ |
|
|
|
|
|
|
|
|
|
@@ -28,8 +28,7 @@ public static async Task<bool> TEST_ReverseConnectionCanRecycleWhileTracing() |
|
currentAssembly: Assembly.GetExecutingAssembly(), |
|
environment: new Dictionary<string,string> |
|
{ |
|
- { Utils.DiagnosticsMonitorAddressEnvKey, serverName }, |
|
- { Utils.DiagnosticsMonitorPauseOnStartEnvKey, "0" } |
|
+ { Utils.DiagnosticPortsEnvKey, $"{serverName},connect,nosuspend" } |
|
}, |
|
duringExecution: async (int pid) => |
|
{ |
|
|