Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(351)

Unified Diff: gpu/command_buffer/service/renderbuffer_manager.cc

Issue 2382573002: Add BACKGROUND dump mode to various GPU/CC MemoryDumpProviders (Closed)
Patch Set: rebase Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gpu/command_buffer/service/buffer_manager.cc ('k') | gpu/command_buffer/service/texture_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/renderbuffer_manager.cc
diff --git a/gpu/command_buffer/service/renderbuffer_manager.cc b/gpu/command_buffer/service/renderbuffer_manager.cc
index 203e74b849d661b1dab15eaa849b41e5069707a9..b28f04571fc6fa84a12a34f60e977c17b34d5e0e 100644
--- a/gpu/command_buffer/service/renderbuffer_manager.cc
+++ b/gpu/command_buffer/service/renderbuffer_manager.cc
@@ -250,6 +250,20 @@ GLenum RenderbufferManager::InternalRenderbufferFormatToImplFormat(
bool RenderbufferManager::OnMemoryDump(
const base::trace_event::MemoryDumpArgs& args,
base::trace_event::ProcessMemoryDump* pmd) {
+ using base::trace_event::MemoryAllocatorDump;
+ using base::trace_event::MemoryDumpLevelOfDetail;
+
+ if (args.level_of_detail == MemoryDumpLevelOfDetail::BACKGROUND) {
+ std::string dump_name = base::StringPrintf(
+ "gpu/gl/renderbuffers/client_%d/", memory_tracker_->ClientId());
+ MemoryAllocatorDump* dump = pmd->CreateAllocatorDump(dump_name);
+ dump->AddScalar(MemoryAllocatorDump::kNameSize,
+ MemoryAllocatorDump::kUnitsBytes, mem_represented());
+
+ // Early out, no need for more detail in a BACKGROUND dump.
+ return true;
+ }
+
int client_id = memory_tracker_->ClientId();
for (const auto& renderbuffer_entry : renderbuffers_) {
const auto& client_renderbuffer_id = renderbuffer_entry.first;
@@ -258,10 +272,9 @@ bool RenderbufferManager::OnMemoryDump(
std::string dump_name =
base::StringPrintf("gpu/gl/renderbuffers/client_%d/renderbuffer_%d",
client_id, client_renderbuffer_id);
- base::trace_event::MemoryAllocatorDump* dump =
- pmd->CreateAllocatorDump(dump_name);
- dump->AddScalar(base::trace_event::MemoryAllocatorDump::kNameSize,
- base::trace_event::MemoryAllocatorDump::kUnitsBytes,
+ MemoryAllocatorDump* dump = pmd->CreateAllocatorDump(dump_name);
+ dump->AddScalar(MemoryAllocatorDump::kNameSize,
+ MemoryAllocatorDump::kUnitsBytes,
static_cast<uint64_t>(renderbuffer->EstimatedSize()));
auto guid = gl::GetGLRenderbufferGUIDForTracing(
@@ -269,6 +282,7 @@ bool RenderbufferManager::OnMemoryDump(
pmd->CreateSharedGlobalAllocatorDump(guid);
pmd->AddOwnershipEdge(dump->guid(), guid);
}
+
return true;
}
« no previous file with comments | « gpu/command_buffer/service/buffer_manager.cc ('k') | gpu/command_buffer/service/texture_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698