diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2022-05-17 17:24:03 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2022-06-22 07:51:41 +0000 |
commit | 774f54339e5db91f785733232d3950366db65d07 (patch) | |
tree | 068e1b47bd1af94d77094ed12b604a6b83d9c22a /chromium/components/heap_profiling | |
parent | f7eaed5286974984ba5f9e3189d8f49d03e99f81 (diff) | |
download | qtwebengine-chromium-774f54339e5db91f785733232d3950366db65d07.tar.gz |
BASELINE: Update Chromium to 102.0.5005.57
Change-Id: I885f714bb40ee724c28f94ca6bd8dbdb39915158
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/components/heap_profiling')
5 files changed, 42 insertions, 8 deletions
diff --git a/chromium/components/heap_profiling/OWNERS b/chromium/components/heap_profiling/OWNERS index 14e4c82394e..9fa97571f64 100644 --- a/chromium/components/heap_profiling/OWNERS +++ b/chromium/components/heap_profiling/OWNERS @@ -1,4 +1,5 @@ erikchen@chromium.org etienneb@chromium.org joenotcharles@google.com +rohitrao@chromium.org ssid@chromium.org
\ No newline at end of file diff --git a/chromium/components/heap_profiling/in_process/OWNERS b/chromium/components/heap_profiling/in_process/OWNERS deleted file mode 100644 index 91264db4add..00000000000 --- a/chromium/components/heap_profiling/in_process/OWNERS +++ /dev/null @@ -1,2 +0,0 @@ -erikchen@chromium.org -rohitrao@chromium.org diff --git a/chromium/components/heap_profiling/in_process/heap_profiler_controller.cc b/chromium/components/heap_profiling/in_process/heap_profiler_controller.cc index 8b17b88148a..77e26ad2c4a 100644 --- a/chromium/components/heap_profiling/in_process/heap_profiler_controller.cc +++ b/chromium/components/heap_profiling/in_process/heap_profiler_controller.cc @@ -17,7 +17,6 @@ #include "base/sampling_heap_profiler/sampling_heap_profiler.h" #include "base/strings/strcat.h" #include "base/strings/string_piece.h" -#include "base/task/post_task.h" #include "base/task/thread_pool.h" #include "base/threading/sequenced_task_runner_handle.h" #include "base/time/time.h" @@ -45,17 +44,30 @@ constexpr int kDefaultSamplingRateBytes = 10'000'000; constexpr int kDefaultCollectionIntervalInMinutes = 24 * 60; #endif +#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_APPLE) && defined(ARCH_CPU_ARM64) +// DecideIfCollectionIsEnabled is stubbed out so kStableProbability and +// kNonStableProbability are never referenced. +#else // Sets the chance that this client will report heap samples through a metrics // provider if it's on the stable channel. constexpr base::FeatureParam<double> kStableProbability{ - &HeapProfilerController::kHeapProfilerReporting, "stable-probability", - 0.01}; + &HeapProfilerController::kHeapProfilerReporting, "stable-probability", +#if BUILDFLAG(IS_ANDROID) + // With stable-probability 0.01 we get about 4x as many records as before + // https://crrev.com/c/3309878 landed in 98.0.4742.0, even with ARM64 + // disabled. This is too high a volume to process. + 0.0025 +#else + 0.01 +#endif +}; // Sets the chance that this client will report heap samples through a metrics // provider if it's on a non-stable channel. constexpr base::FeatureParam<double> kNonStableProbability{ &HeapProfilerController::kHeapProfilerReporting, "nonstable-probability", 0.5}; +#endif // Sets heap sampling interval in bytes. constexpr base::FeatureParam<int> kSamplingRateBytes{ @@ -80,8 +92,15 @@ base::TimeDelta RandomInterval(base::TimeDelta mean) { } bool DecideIfCollectionIsEnabled(version_info::Channel channel) { - // TODO(crbug.com/1271555): Register a synthetic field trial - // (go/synthetic-trials) to keep track of which clients are opted in. +#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_APPLE) && defined(ARCH_CPU_ARM64) + // TODO(crbug.com/1297724): The POSIX implementation of + // ModuleCache::CreateModuleForAddress is stubbed out on ARM64, so all samples + // would lack module information (see base/profiler/module_cache_posix.cc). + // Without this the reports cannot be symbolized so no point in collecting + // them. If this is fixed, also re-enable the tests in + // heap_profiler_controller_unittests.cc. + return false; +#else if (!base::FeatureList::IsEnabled( HeapProfilerController::kHeapProfilerReporting)) return false; @@ -89,6 +108,7 @@ bool DecideIfCollectionIsEnabled(version_info::Channel channel) { ? kStableProbability.Get() : kNonStableProbability.Get(); return base::RandDouble() < probability; +#endif } // Records a time histogram for the `interval` between snapshots, using the diff --git a/chromium/components/heap_profiling/in_process/heap_profiler_controller_unittest.cc b/chromium/components/heap_profiling/in_process/heap_profiler_controller_unittest.cc index cbd0258ec32..0fff757e680 100644 --- a/chromium/components/heap_profiling/in_process/heap_profiler_controller_unittest.cc +++ b/chromium/components/heap_profiling/in_process/heap_profiler_controller_unittest.cc @@ -83,6 +83,14 @@ class HeapProfilerControllerTest : public ::testing::Test { base::DoNothing()); } +#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_APPLE) && defined(ARCH_CPU_ARM64) + void SetUp() override { + // TODO(crbug.com/1297724): The heap profiler is never started on these + // platforms so there is nothing to test. + GTEST_SKIP(); + } +#endif + void StartHeapProfiling( version_info::Channel channel, base::RepeatingCallback<void(base::TimeTicks, metrics::SampledProfile)> @@ -259,7 +267,13 @@ TEST_P(HeapProfilerControllerFeatureTest, StableChannel) { EXPECT_EQ(sample_received_, GetParam().expect_stable_sample); } -TEST_P(HeapProfilerControllerFeatureTest, CanaryChannel) { +// TODO(crbug.com/1302007): This test hangs on iPad device. +#if BUILDFLAG(IS_IOS) +#define MAYBE_CanaryChannel DISABLED_CanaryChannel +#else +#define MAYBE_CanaryChannel CanaryChannel +#endif +TEST_P(HeapProfilerControllerFeatureTest, MAYBE_CanaryChannel) { StartHeapProfiling( version_info::Channel::CANARY, base::BindRepeating(&HeapProfilerControllerTest::RecordSampleReceived, diff --git a/chromium/components/heap_profiling/multi_process/supervisor.cc b/chromium/components/heap_profiling/multi_process/supervisor.cc index 68414503d51..374673b2991 100644 --- a/chromium/components/heap_profiling/multi_process/supervisor.cc +++ b/chromium/components/heap_profiling/multi_process/supervisor.cc @@ -8,6 +8,7 @@ #include "base/callback_helpers.h" #include "base/memory/ref_counted_memory.h" #include "base/no_destructor.h" +#include "base/threading/thread_task_runner_handle.h" #include "base/trace_event/memory_dump_manager.h" #include "components/heap_profiling/multi_process/client_connection_manager.h" #include "components/services/heap_profiling/heap_profiling_service.h" |