Skip to content

Commit

Permalink
Change location where we output message about notification profilers …
Browse files Browse the repository at this point in the history
…being disabled (#69538)
  • Loading branch information
davmason authored May 20, 2022
1 parent fa3a089 commit 3914bcc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/coreclr/dlls/mscorrc/mscorrc.rc
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@ BEGIN
IDS_PROF_V2PROFILER_DISABLED "Loading profiler failed. The profiler that was configured to load was designed for an older version of the CLR. You can use the DOTNET_ProfAPI_ProfilerCompatibilitySetting environment variable to allow older profilers to be loaded by the current version of the CLR. Please consult the documentation for information on how to use this environment variable, and the risks associated with it. Profiler CLSID: '%s'.\n"
IDS_PROF_V2PROFILER_ENABLED "A profiler designed for an older version of the CLR was loaded because of the environment variable setting below. Older profilers will continue to work in many cases, but if you encounter problems, please consider upgrading the profiler or changing the setting of the environment variable. Please consult the documentation for information on how to use this environment variable, and the risks associated with it. Environment variable setting: %s=%s. Profiler CLSID: '%s'.\n"
IDS_PROF_PROFILER_DISABLED "Profilers will not be loaded by the current version of the CLR because of the environment variable setting below. Please consult the documentation for information on how to use this environment variable, and the risks associated with it. Environment variable setting: %s=%s. Profiler CLSID: '%s'.\n"
IDS_E_PROF_NOTIFICATION_DISABLED "Profiler was prevented from loading notification profiler due to app settings.\n"
IDS_E_PROF_NOTIFICATION_DISABLED "Notification profiler was prevented from loading because it was explicitly disabled by app settings.\n"
IDS_E_PROF_NOTIFICATION_LIMIT_EXCEEDED "Notification profiler was prevented from loading because the limit of notification profilers was reached.\n"
IDS_E_PROF_TIMEOUT_WAITING_FOR_CONCURRENT_GC "Profiler timed out on waiting for concurrent GC to finish after '%d' milliseconds. Please configure your profiler to increase its attaching time out value and try again. Profiler CLSID: '%s'.\n"
IDS_PROF_ALREADY_LOADED "A request was made to load a profiler when a profiler was already loaded.\n"
Expand Down
16 changes: 8 additions & 8 deletions src/coreclr/vm/profilinghelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -756,14 +756,6 @@ HRESULT ProfilingAPIUtility::AttemptLoadDelayedStartupProfilers()
HRESULT ProfilingAPIUtility::AttemptLoadProfilerList()
{
HRESULT hr = S_OK;
DWORD dwEnabled = CLRConfig::GetConfigValue(CLRConfig::EXTERNAL_CORECLR_ENABLE_NOTIFICATION_PROFILERS);
if (dwEnabled == 0)
{
// Profiler list explicitly disabled, bail
LogProfInfo(IDS_E_PROF_NOTIFICATION_DISABLED);
return S_OK;
}

NewArrayHolder<WCHAR> wszProfilerList(NULL);

#if defined(TARGET_ARM64)
Expand All @@ -789,6 +781,14 @@ HRESULT ProfilingAPIUtility::AttemptLoadProfilerList()
}
}

DWORD dwEnabled = CLRConfig::GetConfigValue(CLRConfig::EXTERNAL_CORECLR_ENABLE_NOTIFICATION_PROFILERS);
if (dwEnabled == 0)
{
// Profiler list explicitly disabled, bail
LogProfInfo(IDS_E_PROF_NOTIFICATION_DISABLED);
return S_OK;
}

WCHAR *pOuter = NULL;
WCHAR *pInner = NULL;
WCHAR *currentSection = NULL;
Expand Down

0 comments on commit 3914bcc

Please sign in to comment.