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

Commit

Permalink
Do not create diagnostics server thread and pipe if EnableDiagnostics…
Browse files Browse the repository at this point in the history
… 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
  • Loading branch information
sywhang authored Oct 15, 2019
1 parent 1a41127 commit c2bb306
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/inc/clrconfigvalues.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ CONFIG_DWORD_INFO_EX(INTERNAL_BreakOnUncaughtException, W("BreakOnUncaughtExcept

/// Debugger
///
RETAIL_CONFIG_DWORD_INFO_EX(EXTERNAL_EnableDiagnostics, W("EnableDiagnostics"), 1, "Allows the debugger and profiler diagnostics to be disabled", CLRConfig::REGUTIL_default)
RETAIL_CONFIG_DWORD_INFO_EX(EXTERNAL_EnableDiagnostics, W("EnableDiagnostics"), 1, "Allows the debugger, profiler, and EventPipe diagnostics to be disabled", CLRConfig::REGUTIL_default)
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)
CONFIG_DWORD_INFO_EX(INTERNAL_DbgBreakIfLocksUnavailable, W("DbgBreakIfLocksUnavailable"), 0, "Allows an assert when the debugger can't take a lock ", CLRConfig::REGUTIL_default)
CONFIG_DWORD_INFO_EX(INTERNAL_DbgBreakOnErr, W("DbgBreakOnErr"), 0, "Allows an assert when we get a failing hresult", CLRConfig::REGUTIL_default)
Expand Down
6 changes: 6 additions & 0 deletions src/vm/diagnosticserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,12 @@ bool DiagnosticServer::Initialize()
}
CONTRACTL_END;

// COMPlus_EnableDiagnostics==0 disables diagnostics so we don't create the diagnostics pipe/socket or diagnostics server thread
if (CLRConfig::GetConfigValue(CLRConfig::EXTERNAL_EnableDiagnostics) == 0)
{
return true;
}

bool fSuccess = false;

EX_TRY
Expand Down

0 comments on commit c2bb306

Please sign in to comment.