Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit c2bb306

Browse files
authored
Do not create diagnostics server thread and pipe if EnableDiagnostics is set to 0 (#27137) (#27140)
* Do not create diagnostics server thread and pipe if EnableDiagnostics is set to 0 * Remove unnecessary check for config var in DiagnosticServer::Shutdown
1 parent 1a41127 commit c2bb306

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/inc/clrconfigvalues.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ CONFIG_DWORD_INFO_EX(INTERNAL_BreakOnUncaughtException, W("BreakOnUncaughtExcept
159159

160160
/// Debugger
161161
///
162-
RETAIL_CONFIG_DWORD_INFO_EX(EXTERNAL_EnableDiagnostics, W("EnableDiagnostics"), 1, "Allows the debugger and profiler diagnostics to be disabled", CLRConfig::REGUTIL_default)
162+
RETAIL_CONFIG_DWORD_INFO_EX(EXTERNAL_EnableDiagnostics, W("EnableDiagnostics"), 1, "Allows the debugger, profiler, and EventPipe diagnostics to be disabled", CLRConfig::REGUTIL_default)
163163
CONFIG_DWORD_INFO_EX(INTERNAL_D__FCE, W("D::FCE"), 0, "Allows an assert when crawling the managed stack for an exception handler", CLRConfig::REGUTIL_default)
164164
CONFIG_DWORD_INFO_EX(INTERNAL_DbgBreakIfLocksUnavailable, W("DbgBreakIfLocksUnavailable"), 0, "Allows an assert when the debugger can't take a lock ", CLRConfig::REGUTIL_default)
165165
CONFIG_DWORD_INFO_EX(INTERNAL_DbgBreakOnErr, W("DbgBreakOnErr"), 0, "Allows an assert when we get a failing hresult", CLRConfig::REGUTIL_default)

src/vm/diagnosticserver.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,12 @@ bool DiagnosticServer::Initialize()
116116
}
117117
CONTRACTL_END;
118118

119+
// COMPlus_EnableDiagnostics==0 disables diagnostics so we don't create the diagnostics pipe/socket or diagnostics server thread
120+
if (CLRConfig::GetConfigValue(CLRConfig::EXTERNAL_EnableDiagnostics) == 0)
121+
{
122+
return true;
123+
}
124+
119125
bool fSuccess = false;
120126

121127
EX_TRY

0 commit comments

Comments
 (0)