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

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

Issue 2382573002: Add BACKGROUND dump mode to various GPU/CC MemoryDumpProviders (Closed)
Patch Set: Created 4 years, 3 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
Index: gpu/command_buffer/service/buffer_manager.cc
diff --git a/gpu/command_buffer/service/buffer_manager.cc b/gpu/command_buffer/service/buffer_manager.cc
index f28f26ca3e920df2e82af1089c858b7959c63b86..681c69c3444016344fec463e13c4ae1614a6a69e 100644
--- a/gpu/command_buffer/service/buffer_manager.cc
+++ b/gpu/command_buffer/service/buffer_manager.cc
@@ -643,25 +643,36 @@ void BufferManager::SetPrimitiveRestartFixedIndexIfNecessary(GLenum type) {
bool BufferManager::OnMemoryDump(const base::trace_event::MemoryDumpArgs& args,
base::trace_event::ProcessMemoryDump* pmd) {
- const uint64_t share_group_tracing_guid =
- memory_tracker_->ShareGroupTracingGUID();
- for (const auto& buffer_entry : buffers_) {
- const auto& client_buffer_id = buffer_entry.first;
- const auto& buffer = buffer_entry.second;
+ 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/buffers/share_group_%" PRIu64 "/buffer_%d",
- share_group_tracing_guid, client_buffer_id);
- base::trace_event::MemoryAllocatorDump* dump =
- pmd->CreateAllocatorDump(dump_name);
- dump->AddScalar(base::trace_event::MemoryAllocatorDump::kNameSize,
- base::trace_event::MemoryAllocatorDump::kUnitsBytes,
- static_cast<uint64_t>(buffer->size()));
-
- auto guid = gl::GetGLBufferGUIDForTracing(share_group_tracing_guid,
- client_buffer_id);
- pmd->CreateSharedGlobalAllocatorDump(guid);
- pmd->AddOwnershipEdge(dump->guid(), guid);
+ base::StringPrintf("gpu/gl/buffers/share_group_%" PRIu64 "",
+ memory_tracker_->ShareGroupTracingGUID());
+ MemoryAllocatorDump* dump = pmd->CreateAllocatorDump(dump_name);
+ dump->AddScalar(MemoryAllocatorDump::kNameSize,
+ MemoryAllocatorDump::kUnitsBytes, mem_represented());
ssid 2016/10/07 00:07:21 ditto
ericrk 2016/10/13 23:58:13 Done.
+ } else {
+ const uint64_t share_group_tracing_guid =
+ memory_tracker_->ShareGroupTracingGUID();
+ for (const auto& buffer_entry : buffers_) {
+ const auto& client_buffer_id = buffer_entry.first;
+ const auto& buffer = buffer_entry.second;
+
+ std::string dump_name =
+ base::StringPrintf("gpu/gl/buffers/share_group_%" PRIu64 "/buffer_%d",
+ share_group_tracing_guid, client_buffer_id);
+ MemoryAllocatorDump* dump = pmd->CreateAllocatorDump(dump_name);
+ dump->AddScalar(MemoryAllocatorDump::kNameSize,
+ MemoryAllocatorDump::kUnitsBytes,
+ static_cast<uint64_t>(buffer->size()));
+
+ auto guid = gl::GetGLBufferGUIDForTracing(share_group_tracing_guid,
+ client_buffer_id);
+ pmd->CreateSharedGlobalAllocatorDump(guid);
+ pmd->AddOwnershipEdge(dump->guid(), guid);
+ }
}
return true;
}

Powered by Google App Engine
This is Rietveld 408576698