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

Side by Side Diff: third_party/tcmalloc/chromium/src/deep-heap-profile.cc

Issue 14769008: Fix mmap region iteration while no regions are recorded. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | third_party/tcmalloc/chromium/src/memory_region_map.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 // --- 5 // ---
6 // Author: Sainbayar Sukhbaatar 6 // Author: Sainbayar Sukhbaatar
7 // Dai Mikurube 7 // Dai Mikurube
8 // 8 //
9 9
10 #include "deep-heap-profile.h" 10 #include "deep-heap-profile.h"
(...skipping 628 matching lines...) Expand 10 before | Expand all | Expand 10 after
639 char* filename; 639 char* filename;
640 enum MapsRegionType type; 640 enum MapsRegionType type;
641 for (int i = 0; i < NUMBER_OF_MAPS_REGION_TYPES; ++i) { 641 for (int i = 0; i < NUMBER_OF_MAPS_REGION_TYPES; ++i) {
642 all_[i].Initialize(); 642 all_[i].Initialize();
643 unhooked_[i].Initialize(); 643 unhooked_[i].Initialize();
644 } 644 }
645 profiled_mmap_.Initialize(); 645 profiled_mmap_.Initialize();
646 646
647 MemoryRegionMap::RegionIterator mmap_iter = 647 MemoryRegionMap::RegionIterator mmap_iter =
648 MemoryRegionMap::BeginRegionLocked(); 648 MemoryRegionMap::BeginRegionLocked();
649 DeepBucket* deep_bucket = GetInformationOfMemoryRegion( 649 DeepBucket* deep_bucket = NULL;
650 mmap_iter, memory_residence_info_getter, deep_profile); 650 if (mmap_iter != MemoryRegionMap::EndRegionLocked()) {
651 deep_bucket = GetInformationOfMemoryRegion(
652 mmap_iter, memory_residence_info_getter, deep_profile);
653 }
651 654
652 while (procmaps_iter.Next(&vma_start_addr, &vma_last_addr, 655 while (procmaps_iter.Next(&vma_start_addr, &vma_last_addr,
653 &flags, &offset, &inode, &filename)) { 656 &flags, &offset, &inode, &filename)) {
654 if (mmap_dump_buffer) { 657 if (mmap_dump_buffer) {
655 char buffer[1024]; 658 char buffer[1024];
656 int written = procmaps_iter.FormatLine(buffer, sizeof(buffer), 659 int written = procmaps_iter.FormatLine(buffer, sizeof(buffer),
657 vma_start_addr, vma_last_addr, 660 vma_start_addr, vma_last_addr,
658 flags, offset, inode, filename, 0); 661 flags, offset, inode, filename, 0);
659 mmap_dump_buffer->AppendString(buffer, 0); 662 mmap_dump_buffer->AppendString(buffer, 0);
660 } 663 }
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
920 } 923 }
921 924
922 DeepHeapProfile::~DeepHeapProfile() { 925 DeepHeapProfile::~DeepHeapProfile() {
923 } 926 }
924 927
925 int DeepHeapProfile::FillOrderedProfile(char raw_buffer[], int buffer_size) { 928 int DeepHeapProfile::FillOrderedProfile(char raw_buffer[], int buffer_size) {
926 return heap_profile_->FillOrderedProfile(raw_buffer, buffer_size); 929 return heap_profile_->FillOrderedProfile(raw_buffer, buffer_size);
927 } 930 }
928 931
929 #endif // USE_DEEP_HEAP_PROFILE 932 #endif // USE_DEEP_HEAP_PROFILE
OLDNEW
« no previous file with comments | « no previous file | third_party/tcmalloc/chromium/src/memory_region_map.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698