OLD | NEW |
---|---|
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 622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
633 // /proc/maps independently. The iterator for MemoryRegionMap is initialized | 633 // /proc/maps independently. The iterator for MemoryRegionMap is initialized |
634 // at the top outside the loop for /proc/maps, and it goes forward inside the | 634 // at the top outside the loop for /proc/maps, and it goes forward inside the |
635 // loop while comparing their addresses. | 635 // loop while comparing their addresses. |
636 // | 636 // |
637 // TODO(dmikurube): Eliminate dynamic memory allocation caused by snprintf. | 637 // TODO(dmikurube): Eliminate dynamic memory allocation caused by snprintf. |
638 void DeepHeapProfile::GlobalStats::SnapshotMaps( | 638 void DeepHeapProfile::GlobalStats::SnapshotMaps( |
639 const MemoryResidenceInfoGetterInterface* memory_residence_info_getter, | 639 const MemoryResidenceInfoGetterInterface* memory_residence_info_getter, |
640 DeepHeapProfile* deep_profile, | 640 DeepHeapProfile* deep_profile, |
641 TextBuffer* mmap_dump_buffer) { | 641 TextBuffer* mmap_dump_buffer) { |
642 MemoryRegionMap::LockHolder lock_holder; | 642 MemoryRegionMap::LockHolder lock_holder; |
643 | |
Dai Mikurube (NOT FULLTIME)
2013/05/03 08:53:00
nit: empty line
bulach
2013/05/07 14:55:51
Done.
| |
643 ProcMapsIterator::Buffer procmaps_iter_buffer; | 644 ProcMapsIterator::Buffer procmaps_iter_buffer; |
644 ProcMapsIterator procmaps_iter(0, &procmaps_iter_buffer); | 645 ProcMapsIterator procmaps_iter(0, &procmaps_iter_buffer); |
645 uint64 vma_start_addr, vma_last_addr, offset; | 646 uint64 vma_start_addr, vma_last_addr, offset; |
646 int64 inode; | 647 int64 inode; |
647 char* flags; | 648 char* flags; |
648 char* filename; | 649 char* filename; |
649 enum MapsRegionType type; | 650 enum MapsRegionType type; |
650 for (int i = 0; i < NUMBER_OF_MAPS_REGION_TYPES; ++i) { | 651 for (int i = 0; i < NUMBER_OF_MAPS_REGION_TYPES; ++i) { |
651 all_[i].Initialize(); | 652 all_[i].Initialize(); |
652 unhooked_[i].Initialize(); | 653 unhooked_[i].Initialize(); |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
932 } | 933 } |
933 | 934 |
934 DeepHeapProfile::~DeepHeapProfile() { | 935 DeepHeapProfile::~DeepHeapProfile() { |
935 } | 936 } |
936 | 937 |
937 int DeepHeapProfile::FillOrderedProfile(char raw_buffer[], int buffer_size) { | 938 int DeepHeapProfile::FillOrderedProfile(char raw_buffer[], int buffer_size) { |
938 return heap_profile_->FillOrderedProfile(raw_buffer, buffer_size); | 939 return heap_profile_->FillOrderedProfile(raw_buffer, buffer_size); |
939 } | 940 } |
940 | 941 |
941 #endif // USE_DEEP_HEAP_PROFILE | 942 #endif // USE_DEEP_HEAP_PROFILE |
OLD | NEW |