Commit 44f6ea57 authored by Mike Wittman's avatar Mike Wittman Committed by Commit Bot

[Sampling profiler] Enable on ARM32 Android canary for render thread

Enables the ThreadProfiler on Android canary channel Chrome releases
for ARM32. The profiler is enabled solely on the renderer main thread
for now, pending stability and performance metrics from the wild.

Bug: 1004855
Change-Id: If393653adf362f3fccbfa93078f45d88284fc81b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2433125
Commit-Queue: Mike Wittman <wittman@chromium.org>
Reviewed-by: default avatarEtienne Pierre-Doray <etiennep@chromium.org>
Cr-Commit-Position: refs/heads/master@{#813548}
parent d83eb582
......@@ -192,6 +192,13 @@ double AndroidPlatformConfiguration::GetChildProcessEnableFraction(
if (browser_test_mode_enabled())
return DefaultPlatformConfiguration::GetChildProcessEnableFraction(process);
// Enable just on renderer process for now. Enabling for 40% of renderer
// processes samples roughly one renderer process on average for every Chrome
// execution, based on early channel data in the
// Memory.RenderProcessHost.Count.InitializedAndNotDead histogram.
if (process == metrics::CallStackProfileParams::RENDERER_PROCESS)
return 0.4;
// TODO(https://crbug.com/1004855): Enable for all the default processes.
return 0.0;
}
......@@ -199,15 +206,23 @@ double AndroidPlatformConfiguration::GetChildProcessEnableFraction(
bool AndroidPlatformConfiguration::IsEnabledForThread(
metrics::CallStackProfileParams::Process process,
metrics::CallStackProfileParams::Thread thread) const {
// Disable for all supported threads pending launch. Enable only for browser
// tests.
// Enable on renderer process main thread in production, for now.
if (process == metrics::CallStackProfileParams::RENDERER_PROCESS &&
thread == metrics::CallStackProfileParams::MAIN_THREAD) {
return true;
}
// Otherwise enable in dedicated ThreadProfiler browser tests.
return browser_test_mode_enabled();
}
bool AndroidPlatformConfiguration::IsSupportedForChannel(
base::Optional<version_info::Channel> release_channel) const {
// On Android profiling is only enabled in its own dedicated browser tests
// in local builds and the CQ.
// Enable on canary, for now.
if (release_channel && *release_channel == version_info::Channel::CANARY)
return true;
// Otherwise enable in dedicated ThreadProfiler browser tests.
// TODO(https://crbug.com/1004855): Enable across all browser tests.
return browser_test_mode_enabled();
}
......
......@@ -72,7 +72,7 @@ TEST_F(ThreadProfilerPlatformConfigurationTest, IsSupported) {
EXPECT_FALSE(config()->IsSupported(base::nullopt));
#elif defined(OS_ANDROID)
EXPECT_FALSE(config()->IsSupported(version_info::Channel::UNKNOWN));
EXPECT_FALSE(config()->IsSupported(version_info::Channel::CANARY));
EXPECT_TRUE(config()->IsSupported(version_info::Channel::CANARY));
EXPECT_FALSE(config()->IsSupported(version_info::Channel::DEV));
EXPECT_FALSE(config()->IsSupported(version_info::Channel::BETA));
EXPECT_FALSE(config()->IsSupported(version_info::Channel::STABLE));
......@@ -126,14 +126,15 @@ MAYBE_PLATFORM_CONFIG_TEST_F(ThreadProfilerPlatformConfigurationTest,
MAYBE_PLATFORM_CONFIG_TEST_F(ThreadProfilerPlatformConfigurationTest,
GetEnableRates) {
// Note: death tests aren't supported on Android. Otherwise this test would
// check that all inputs result in CHECKs.
#if !defined(OS_ANDROID)
using RelativePopulations =
ThreadProfilerPlatformConfiguration::RelativePopulations;
EXPECT_CHECK_DEATH(config()->GetEnableRates(version_info::Channel::UNKNOWN));
EXPECT_EQ((RelativePopulations{80, 20}),
config()->GetEnableRates(version_info::Channel::CANARY));
#if defined(OS_ANDROID)
// Note: death tests aren't supported on Android. Otherwise this test would
// check that the other inputs result in CHECKs.
#else
EXPECT_CHECK_DEATH(config()->GetEnableRates(version_info::Channel::UNKNOWN));
EXPECT_EQ((RelativePopulations{80, 20}),
config()->GetEnableRates(version_info::Channel::DEV));
EXPECT_CHECK_DEATH(config()->GetEnableRates(version_info::Channel::BETA));
......@@ -149,7 +150,7 @@ MAYBE_PLATFORM_CONFIG_TEST_F(ThreadProfilerPlatformConfigurationTest,
#if defined(OS_ANDROID)
EXPECT_EQ(0.0, config()->GetChildProcessEnableFraction(
metrics::CallStackProfileParams::GPU_PROCESS));
EXPECT_EQ(0.0, config()->GetChildProcessEnableFraction(
EXPECT_EQ(0.4, config()->GetChildProcessEnableFraction(
metrics::CallStackProfileParams::RENDERER_PROCESS));
EXPECT_EQ(0.0, config()->GetChildProcessEnableFraction(
metrics::CallStackProfileParams::NETWORK_SERVICE_PROCESS));
......@@ -191,7 +192,7 @@ MAYBE_PLATFORM_CONFIG_TEST_F(ThreadProfilerPlatformConfigurationTest,
metrics::CallStackProfileParams::GPU_PROCESS,
metrics::CallStackProfileParams::COMPOSITOR_THREAD));
EXPECT_FALSE(config()->IsEnabledForThread(
EXPECT_TRUE(config()->IsEnabledForThread(
metrics::CallStackProfileParams::RENDERER_PROCESS,
metrics::CallStackProfileParams::MAIN_THREAD));
EXPECT_FALSE(config()->IsEnabledForThread(
......
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