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

Unified Diff: gpu/command_buffer/client/gles2_implementation.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/client/cmd_buffer_helper.cc ('k') | gpu/command_buffer/client/mapped_memory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/client/gles2_implementation.cc
diff --git a/gpu/command_buffer/client/gles2_implementation.cc b/gpu/command_buffer/client/gles2_implementation.cc
index cbbe0f49544afd6eacf12b52d410382726757db9..aefc52ac8daf96a60dc4d10a884e73a814f3294a 100644
--- a/gpu/command_buffer/client/gles2_implementation.cc
+++ b/gpu/command_buffer/client/gles2_implementation.cc
@@ -434,6 +434,9 @@ void GLES2Implementation::SetAggressivelyFreeResources(
bool GLES2Implementation::OnMemoryDump(
const base::trace_event::MemoryDumpArgs& args,
base::trace_event::ProcessMemoryDump* pmd) {
+ using base::trace_event::MemoryAllocatorDump;
+ using base::trace_event::MemoryDumpLevelOfDetail;
+
if (!transfer_buffer_->HaveBuffer())
return true;
@@ -441,20 +444,21 @@ bool GLES2Implementation::OnMemoryDump(
base::trace_event::MemoryDumpManager::GetInstance()
->GetTracingProcessId();
- base::trace_event::MemoryAllocatorDump* dump = pmd->CreateAllocatorDump(
- base::StringPrintf("gpu/transfer_buffer_memory/buffer_%d",
- transfer_buffer_->GetShmId()));
- dump->AddScalar(base::trace_event::MemoryAllocatorDump::kNameSize,
- base::trace_event::MemoryAllocatorDump::kUnitsBytes,
+ MemoryAllocatorDump* dump = pmd->CreateAllocatorDump(base::StringPrintf(
+ "gpu/transfer_buffer_memory/buffer_%d", transfer_buffer_->GetShmId()));
+ dump->AddScalar(MemoryAllocatorDump::kNameSize,
+ MemoryAllocatorDump::kUnitsBytes,
transfer_buffer_->GetSize());
- dump->AddScalar("free_size",
- base::trace_event::MemoryAllocatorDump::kUnitsBytes,
- transfer_buffer_->GetFreeSize());
- auto guid =
- GetBufferGUIDForTracing(tracing_process_id, transfer_buffer_->GetShmId());
- const int kImportance = 2;
- pmd->CreateSharedGlobalAllocatorDump(guid);
- pmd->AddOwnershipEdge(dump->guid(), guid, kImportance);
+
+ if (args.level_of_detail != MemoryDumpLevelOfDetail::BACKGROUND) {
+ dump->AddScalar("free_size", MemoryAllocatorDump::kUnitsBytes,
+ transfer_buffer_->GetFreeSize());
+ auto guid = GetBufferGUIDForTracing(tracing_process_id,
+ transfer_buffer_->GetShmId());
+ const int kImportance = 2;
+ pmd->CreateSharedGlobalAllocatorDump(guid);
+ pmd->AddOwnershipEdge(dump->guid(), guid, kImportance);
+ }
return true;
}
« no previous file with comments | « gpu/command_buffer/client/cmd_buffer_helper.cc ('k') | gpu/command_buffer/client/mapped_memory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698