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

Side by Side Diff: gpu/command_buffer/service/buffer_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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "gpu/command_buffer/service/buffer_manager.h" 5 #include "gpu/command_buffer/service/buffer_manager.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <limits> 9 #include <limits>
10 10
(...skipping 716 matching lines...) Expand 10 before | Expand all | Expand 10 after
727 break; 727 break;
728 } 728 }
729 if (primitive_restart_fixed_index_ != index) { 729 if (primitive_restart_fixed_index_ != index) {
730 glPrimitiveRestartIndex(index); 730 glPrimitiveRestartIndex(index);
731 primitive_restart_fixed_index_ = index; 731 primitive_restart_fixed_index_ = index;
732 } 732 }
733 } 733 }
734 734
735 bool BufferManager::OnMemoryDump(const base::trace_event::MemoryDumpArgs& args, 735 bool BufferManager::OnMemoryDump(const base::trace_event::MemoryDumpArgs& args,
736 base::trace_event::ProcessMemoryDump* pmd) { 736 base::trace_event::ProcessMemoryDump* pmd) {
737 using base::trace_event::MemoryAllocatorDump;
738 using base::trace_event::MemoryDumpLevelOfDetail;
739
740 if (args.level_of_detail == MemoryDumpLevelOfDetail::BACKGROUND) {
741 std::string dump_name =
742 base::StringPrintf("gpu/gl/buffers/share_group_%" PRIu64 "",
743 memory_tracker_->ShareGroupTracingGUID());
744 MemoryAllocatorDump* dump = pmd->CreateAllocatorDump(dump_name);
745 dump->AddScalar(MemoryAllocatorDump::kNameSize,
746 MemoryAllocatorDump::kUnitsBytes, mem_represented());
747
748 // Early out, no need for more detail in a BACKGROUND dump.
749 return true;
750 }
751
737 const uint64_t share_group_tracing_guid = 752 const uint64_t share_group_tracing_guid =
738 memory_tracker_->ShareGroupTracingGUID(); 753 memory_tracker_->ShareGroupTracingGUID();
739 for (const auto& buffer_entry : buffers_) { 754 for (const auto& buffer_entry : buffers_) {
740 const auto& client_buffer_id = buffer_entry.first; 755 const auto& client_buffer_id = buffer_entry.first;
741 const auto& buffer = buffer_entry.second; 756 const auto& buffer = buffer_entry.second;
742 757
743 std::string dump_name = 758 std::string dump_name =
744 base::StringPrintf("gpu/gl/buffers/share_group_%" PRIu64 "/buffer_%d", 759 base::StringPrintf("gpu/gl/buffers/share_group_%" PRIu64 "/buffer_%d",
745 share_group_tracing_guid, client_buffer_id); 760 share_group_tracing_guid, client_buffer_id);
746 base::trace_event::MemoryAllocatorDump* dump = 761 MemoryAllocatorDump* dump = pmd->CreateAllocatorDump(dump_name);
747 pmd->CreateAllocatorDump(dump_name); 762 dump->AddScalar(MemoryAllocatorDump::kNameSize,
748 dump->AddScalar(base::trace_event::MemoryAllocatorDump::kNameSize, 763 MemoryAllocatorDump::kUnitsBytes,
749 base::trace_event::MemoryAllocatorDump::kUnitsBytes,
750 static_cast<uint64_t>(buffer->size())); 764 static_cast<uint64_t>(buffer->size()));
751 765
752 auto guid = gl::GetGLBufferGUIDForTracing(share_group_tracing_guid, 766 auto guid = gl::GetGLBufferGUIDForTracing(share_group_tracing_guid,
753 client_buffer_id); 767 client_buffer_id);
754 pmd->CreateSharedGlobalAllocatorDump(guid); 768 pmd->CreateSharedGlobalAllocatorDump(guid);
755 pmd->AddOwnershipEdge(dump->guid(), guid); 769 pmd->AddOwnershipEdge(dump->guid(), guid);
756 } 770 }
771
757 return true; 772 return true;
758 } 773 }
759 774
760 } // namespace gles2 775 } // namespace gles2
761 } // namespace gpu 776 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/client/mapped_memory.cc ('k') | gpu/command_buffer/service/renderbuffer_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698