Commit 7ce02641 authored by Mike Wittman's avatar Mike Wittman Committed by Commit Bot

[Sampling profiler] Disable profiler when Trend Micro DLLs are in process

Disables the profiler to work around a major performance bug in Trend
Micro's software that gets injected into our processes.

Bug: 1018291, 882982
Change-Id: I04b3b762c3b5cd16258ca6cb63a317e0f33d05ed
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1881980Reviewed-by: default avatarLei Zhang <thestig@chromium.org>
Reviewed-by: default avatarPatrick Monette <pmonette@chromium.org>
Commit-Queue: Mike Wittman <wittman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#710014}
parent b60aa6dc
...@@ -71,6 +71,21 @@ bool ShouldEnableProfilerForNextRendererProcess() { ...@@ -71,6 +71,21 @@ bool ShouldEnableProfilerForNextRendererProcess() {
return base::RandInt(0, 4) == 0; return base::RandInt(0, 4) == 0;
} }
#if defined(OS_WIN)
// Checks if Trend Micro DLLs are loaded in process, so we can disable the
// profiler to avoid hitting their performance bug. See
// https://crbug.com/1018291.
bool IsTrendMicroInProcess() {
#if defined(ARCH_CPU_X86_64)
return (::GetModuleHandle(L"tmmon64.dll") ||
::GetModuleHandle(L"tmmonmgr64.dll"));
#else // defined(ARCH_CPU_X86_64)
return (::GetModuleHandle(L"tmmon.dll") ||
::GetModuleHandle(L"tmmonmgr.dll"));
#endif // defined(ARCH_CPU_X86_64)
}
#endif // defined(OS_WIN)
} // namespace } // namespace
StackSamplingConfiguration::StackSamplingConfiguration() StackSamplingConfiguration::StackSamplingConfiguration()
...@@ -122,6 +137,10 @@ bool StackSamplingConfiguration::GetSyntheticFieldTrial( ...@@ -122,6 +137,10 @@ bool StackSamplingConfiguration::GetSyntheticFieldTrial(
*group_name = "Disabled"; *group_name = "Disabled";
break; break;
case PROFILE_DISABLED_TREND_MICRO:
*group_name = "DisabledTrendMicro";
break;
case PROFILE_CONTROL: case PROFILE_CONTROL:
*group_name = "Control"; *group_name = "Control";
break; break;
...@@ -198,6 +217,13 @@ StackSamplingConfiguration::GenerateConfiguration() { ...@@ -198,6 +217,13 @@ StackSamplingConfiguration::GenerateConfiguration() {
// simultaneously can cause crashes and has no known use case. // simultaneously can cause crashes and has no known use case.
if (GetModuleHandleA(base::win::kApplicationVerifierDllName)) if (GetModuleHandleA(base::win::kApplicationVerifierDllName))
return PROFILE_DISABLED; return PROFILE_DISABLED;
// Do not start the profiler if Trend Micro DLLs are loaded in process to
// avoid hitting their performance bug.
// TODO(https://crbug.com/1018291): Remove once Trend Micro's fixes have
// propagated to customers.
if (IsTrendMicroInProcess())
return PROFILE_DISABLED_TREND_MICRO;
#endif #endif
switch (chrome::GetChannel()) { switch (chrome::GetChannel()) {
......
...@@ -51,6 +51,7 @@ class StackSamplingConfiguration { ...@@ -51,6 +51,7 @@ class StackSamplingConfiguration {
enum ProfileConfiguration { enum ProfileConfiguration {
// Chrome-wide configurations set in the browser process. // Chrome-wide configurations set in the browser process.
PROFILE_DISABLED, PROFILE_DISABLED,
PROFILE_DISABLED_TREND_MICRO,
PROFILE_CONTROL, PROFILE_CONTROL,
PROFILE_ENABLED, PROFILE_ENABLED,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment