FLEDGE: Fix DCHECK about double-registered memory dump providers
...as we use multiple isolates, tweak gin config to make its memory dump naming to account for it. Bug: 324700594 Change-Id: I86128dc76649e3b2766e6e7614530c91d776546a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6391635 Reviewed-by: Camillo Bruni <cbruni@chromium.org> Commit-Queue: Maks Orlovich <morlovich@chromium.org> Reviewed-by: Siddhartha S <ssid@chromium.org> Cr-Commit-Position: refs/heads/main@{#1440320}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
69b9d68bde
commit
78db3624db
@ -289,26 +289,26 @@ constexpr auto kAllocatorDumpNameAllowlist =
|
||||
"v8/main/heap/trusted_large_object_space",
|
||||
"v8/main/malloc",
|
||||
"v8/main/zapped_for_debug",
|
||||
"v8/utility/code_stats",
|
||||
"v8/utility/contexts/detached_context",
|
||||
"v8/utility/contexts/native_context",
|
||||
"v8/utility/global_handles",
|
||||
"v8/utility/heap/code_space",
|
||||
"v8/utility/heap/code_large_object_space",
|
||||
"v8/utility/heap/large_object_space",
|
||||
"v8/utility/heap/map_space",
|
||||
"v8/utility/heap/new_large_object_space",
|
||||
"v8/utility/heap/new_space",
|
||||
"v8/utility/heap/old_space",
|
||||
"v8/utility/heap/read_only_space",
|
||||
"v8/utility/heap/shared_large_object_space",
|
||||
"v8/utility/heap/shared_space",
|
||||
"v8/utility/heap/shared_trusted_large_object_space",
|
||||
"v8/utility/heap/shared_trusted_space",
|
||||
"v8/utility/heap/trusted_space",
|
||||
"v8/utility/heap/trusted_large_object_space",
|
||||
"v8/utility/malloc",
|
||||
"v8/utility/zapped_for_debug",
|
||||
"v8/utility/code_stats/isolate_0x?",
|
||||
"v8/utility/contexts/detached_context/isolate_0x?",
|
||||
"v8/utility/contexts/native_context/isolate_0x?",
|
||||
"v8/utility/global_handles/isolate_0x?",
|
||||
"v8/utility/heap/code_space/isolate_0x?",
|
||||
"v8/utility/heap/code_large_object_space/isolate_0x?",
|
||||
"v8/utility/heap/large_object_space/isolate_0x?",
|
||||
"v8/utility/heap/map_space/isolate_0x?",
|
||||
"v8/utility/heap/new_large_object_space/isolate_0x?",
|
||||
"v8/utility/heap/new_space/isolate_0x?",
|
||||
"v8/utility/heap/old_space/isolate_0x?",
|
||||
"v8/utility/heap/read_only_space/isolate_0x?",
|
||||
"v8/utility/heap/shared_large_object_space/isolate_0x?",
|
||||
"v8/utility/heap/shared_space/isolate_0x?",
|
||||
"v8/utility/heap/shared_trusted_large_object_space/isolate_0x?",
|
||||
"v8/utility/heap/shared_trusted_space/isolate_0x?",
|
||||
"v8/utility/heap/trusted_space/isolate_0x?",
|
||||
"v8/utility/heap/trusted_large_object_space/isolate_0x?",
|
||||
"v8/utility/malloc/isolate_0x?",
|
||||
"v8/utility/zapped_for_debug/isolate_0x?",
|
||||
"v8/workers/code_stats/isolate_0x?",
|
||||
"v8/workers/contexts/detached_context/isolate_0x?",
|
||||
"v8/workers/contexts/native_context/isolate_0x?",
|
||||
|
@ -151,8 +151,9 @@ bool CanHaveMultipleIsolates(IsolateHolder::IsolateType isolate_type) {
|
||||
case IsolateHolder::IsolateType::kTest:
|
||||
NOTREACHED();
|
||||
case IsolateHolder::IsolateType::kUtility:
|
||||
// PDFium and ProxyResolver create one isolate per process.
|
||||
return false;
|
||||
// While PDFium and ProxyResolver create one isolate per process,
|
||||
// auction_worklet_service can have multiple.
|
||||
return true;
|
||||
}
|
||||
NOTREACHED();
|
||||
}
|
||||
|
@ -38,6 +38,15 @@ class V8MemoryDumpProviderWorkerTest : public V8MemoryDumpProviderTest {
|
||||
}
|
||||
};
|
||||
|
||||
class V8MemoryDumpProviderBackgroundModeTest
|
||||
: public V8MemoryDumpProviderTest,
|
||||
public ::testing::WithParamInterface<IsolateHolder::IsolateType> {
|
||||
std::unique_ptr<IsolateHolder> CreateIsolateHolder() const override {
|
||||
return std::make_unique<gin::IsolateHolder>(
|
||||
base::SingleThreadTaskRunner::GetCurrentDefault(), GetParam());
|
||||
}
|
||||
};
|
||||
|
||||
// Checks if the dump provider runs without crashing and dumps root objects.
|
||||
TEST_F(V8MemoryDumpProviderTest, DumpStatistics) {
|
||||
base::trace_event::MemoryDumpArgs dump_args = {
|
||||
@ -213,4 +222,22 @@ TEST_F(V8MemoryDumpProviderTest, Deterministic) {
|
||||
ASSERT_TRUE(weak_ref.IsEmpty());
|
||||
}
|
||||
|
||||
TEST_P(V8MemoryDumpProviderBackgroundModeTest, AllowList) {
|
||||
// Things that are dumped at the background mode level of detail must be
|
||||
// in the allowlist in base/trace_event/memory_infra_background_allowlist.cc
|
||||
base::trace_event::MemoryDumpArgs dump_args = {
|
||||
base::trace_event::MemoryDumpLevelOfDetail::kBackground};
|
||||
std::unique_ptr<base::trace_event::ProcessMemoryDump> process_memory_dump(
|
||||
new base::trace_event::ProcessMemoryDump(dump_args));
|
||||
instance_->isolate_memory_dump_provider_for_testing()->OnMemoryDump(
|
||||
dump_args, process_memory_dump.get());
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
/* no label */,
|
||||
V8MemoryDumpProviderBackgroundModeTest,
|
||||
testing::Values(IsolateHolder::IsolateType::kBlinkMainThread,
|
||||
IsolateHolder::IsolateType::kBlinkWorkerThread,
|
||||
IsolateHolder::IsolateType::kUtility));
|
||||
|
||||
} // namespace gin
|
||||
|
Reference in New Issue
Block a user